|
-
Dec 17th, 2004, 09:27 AM
#1
Thread Starter
Evil Genius
Awkward SELECT statement question
I've got an MSAccess database with 2 tables in, with the following columns:
Table1
UID (number)
Col1 (number)
Col2 (number)
Table2
ID (number)
Desc (text)
Each entry in col1 and col2, equates to table 2's ID field. & what I'd like to return/make in an SQL command is the following
"Grab everything from the Table1 table,
Col1 ordered alphabetically on it's corresponding description column in table2,
Col2 ordered alphabetically on it's corresponding description column in table2"
How can I do this please?????!??!?!?
-
Dec 17th, 2004, 09:58 AM
#2
Fanatic Member
Re: Awkward SELECT statement question
Maybe something like:
Code:
Select t1.[UID]
, t1.[Col1]
, t2a.[Desc]
, t1.[Col2]
, t2b.[Desc]
From Table1 t1 Inner Join Table2 t2a On t1.[Col1] = t2a.[ID]
Inner Join Table2 t2b On t1.[Col2] = t2b.[ID]
Order By t2a.[Desc], t2b.[Desc]
Maybe?
Chris
Master Of My Domain
Got A Question? Look Here First
-
Dec 17th, 2004, 11:28 AM
#3
Thread Starter
Evil Genius
Re: Awkward SELECT statement question
Cheers Chris!
As this was access, I needed to put brackets around this so it worked, but that did the trick thanks!!!!
Code:
From (Table1 t1 Inner Join Table2 t2a On t1.[Col1] = t2a.[ID])
Inner Join Table2 t2b On t1.[Col2] = t2b.[ID]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|