Tech Support Guy banner

SQL query ;)

1666 Views 5 Replies 3 Participants Last post by  Rockn
Hi guys,

I'm trying to solve a little sql problem -- I need to cross reference and dump out a list of records that don't belong. The existing query uses a left join between two tables... I need to add some more 'AND' statements in the WHERE line because the query needs to take into account other tables... hence I need to include those tables in the from line. How do I do this, when there is a left join already there?

For example:

SELECT DISTINCTROW tblOne.*
FROM tblOne LEFT JOIN tblTwo ON [tblOne].[item1]=[tblTwo].[item2]
WHERE ((((DatePart("m",[Date])=[Enter Month])) And [tblTwo].[item2] Is Null));

How can I go about adding:

WHERE ........ AND [tblThree].[item3] Is Null AND [tblFour].[item4] Is Null));

To the end of that?

Quick responses will be much, much appreciated.

Thanks guys!
-Sheist
Status
Not open for further replies.
1 - 1 of 6 Posts
Try looking into how to do sub-queries for your server that you're using. What you do is perform a subquery and then query the results of that to narrow down further.
1 - 1 of 6 Posts
Status
Not open for further replies.
Top