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

? on query

Status
Not open for further replies.

MartDawg

Programmer
Jan 14, 2004
33
US
I have the following query...

It makes a join between 5 tables to pull out some info, name, email, ect.

In my where clause I have some info like

Where (table3.status IN (15,16) and (Table4.otherstatus IN (2,3,5,11)

Here's my question.

I need to pull another piece of data from another table. The data I need is a date field where a status in that table is 10.

I can't add it to the where clause because than it will only bring back the records for the whole query where status = 10.

I think I have to do another (select date from table 6 where status = 10) somewhere inside the other query, but seems to be breaking.

Can somebody give me the syntax to accomplish this?

Thanks
 
Why can't you do this:

Code:
WHERE (table3.status IN (15,16)
  AND Table4.otherstatus IN (2,3,5,11))
  OR Table#.status = 10
BTW, your parenthesis in the example were wrong (you were missing two close parenthesis). I changed them to the above.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top