|
I have a query in which I have multiple clauses in the where clause: When seperate everything works correctly but when I add in the AND operator I am not getting the correct result: Am I missing something? dbo.table1 a1 JOIN dbo.table2 a2 ON a1.[ID]=a2.ID
(comments are locked)
|
|
With the AND both WHERE clauses have to evaluate to TRUE for a result to be returned. But OR will return too many
Aug 16 '12 at 03:22 PM
sqlLearner 1
SQL Server returns what you ask for. Why do you feel you aren't getting the correct result with AND?
Aug 16 '12 at 03:26 PM
Blackhawk-17
Because It is only Returning the IDNumber that are not in the subquery in part 2 of my where clause...It is ignoring the part 1 of my where clause... I want Part 1 which is when the 2 dates arent equal but then of those dates that arent equal the IDNUmber cant be in the subquery of part 2
Aug 16 '12 at 03:32 PM
sqlLearner 1
(comments are locked)
|


What datatype are you using for your date columns?