Dec 7, 2007 #1 TimTDP Technical User Joined Feb 15, 2004 Messages 373 Location ZA I am a newbie! I have two tables. How do I join them in an sql statement so that I can use the data in a report?
I am a newbie! I have two tables. How do I join them in an sql statement so that I can use the data in a report?
Dec 7, 2007 1 #2 Andrzejek Programmer Joined Jan 10, 2006 Messages 8,577 Location US You need to know how the 2 tables relate, which field is the Key, (let's say it is SSN) so you can: Code: SELECT Table1.*, Table2.* FROM Table1, Table2 WHERE Table1.SSN = Table2.SSN ORDER BY Table1.SomeField Have fun. ---- Andy Upvote 0 Downvote
You need to know how the 2 tables relate, which field is the Key, (let's say it is SSN) so you can: Code: SELECT Table1.*, Table2.* FROM Table1, Table2 WHERE Table1.SSN = Table2.SSN ORDER BY Table1.SomeField Have fun. ---- Andy