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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How about this query

Status
Not open for further replies.

adwanoy

MIS
Apr 10, 2006
37
US
Hey, guys this is the case
Table1
Job, Task
1, 101,
1, 102
1, 103
2, 104
3, 105
Table 2
Position, Task
1, 102
1, 130
1, 131
2, 145
2, 146
Table 4 is a repository of the 3 tables
Task, Description
101, aaa
102, bbb
103, ccc
104, ddd
105, eee
130, fff
131, ggg
145, hhh
156, iii
According to user input of Job+Position, say (job=1, position=1) I want to pull out the following:
Job position task
1 1 101, aaa (no duplicate)
1 102, bbb
1 103, ccc
1 130, fff
1 131, ggg
 
Perhaps:
[tt]SELECT Table1.Job, Table2.Position, Table4.Task, Table4.Description
FROM Table2 RIGHT JOIN (Table1 RIGHT JOIN Table4 ON Table1.Task = Table4.Task) ON Table2.Task = Table4.Task
WHERE (((Table1.Job)=1)) OR (((Table2.Position)=1));[/tt]

There is an SQL forum:
Microsoft: Access Queries and JET SQL Forum
forum701
 
GREAT, THANKS
actually I forgot
Table3
Activity, Task
1, 10 2
1, 130
2, 150
2, 151
3, 152
and againg activity=1
how the sql will be for the 4 tables
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top