SQL 2008 SELECT

Hello,
Can you please help,
I'm trying to do a simple select.

SELECT * FROM ScanItem where scanin is Null   (I get proper results - all data )
SELECT * FROM ScanItem where scanin is Null  and CCDriverNumber is NULL (I get proper results)

When I add another AND, I get no results. (i SHOULD GET FEW HUNDERED)
SELECT * FROM ScanItem where scanin is Null  and CCDriverNumber is NULL AND CCDriverNumber <> 2529

What am I missing?

thanks
W.E.BAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
santoshmotwaniConnect With a Mentor Commented:
SELECT * FROM ScanItem where scanin is Null  and CCDriverNumber is NULL
union all
SELECT * FROM ScanItem  where ccdriverNumber <> 2529

or

SELECT * FROM ScanItem where scanin is Null
and
((ccdriverNumber <> 2529) or (ccdriverNumber is null))
0
 
W.E.BAuthor Commented:
This did it, thanks
0
 
W.E.BAuthor Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.