Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Join 1

Status
Not open for further replies.
Mar 17, 2005
147
US
What am I missing here?

SELECT OrderID, DetailOrderID, OrderUserID, DetailProductName, DetailQuantity, DetailPrice, OrderShipping, OrderTotal, OrderDate, Firstname
FROM Orders AS o, OrderDetails AS d, Users AS u
where o_OrderID = d.DetailOrderID
and o_OrderUserID = u.UserID
 
I dont get an error but when I switch to preview the query it doesnt display any data and there are records and relationships.

Steve
 
is it because Users and UserId are keywords??

not sure though...try to wrap them in square braces...something like [UserId]

-DNG
 
I would use o_OrderID ...

but have to guess in which table belongs the fields below, so add them accordingly

SELECT OrderID, DetailOrderID, OrderUserID, DetailProductName, DetailQuantity, DetailPrice, OrderShipping, OrderTotal, OrderDate, Firstname
FROM (Orders AS o Inner Join OrderDetails AS d On o_OrderID = d.DetailOrderID) Inner Join [Users] AS u On
o_OrderUserID = u.UserID

 
You guessed right Jerry, and now shows the top row of the query but no data? Under OrderID it says AutoNumber???

Hmmm.

Thanks for your help with this.
 

Change from SQL view to Design View and play with the grid. I hope the join is Ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top