Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL 2008 SELECT

Posted on 2013-06-05
3
Medium Priority
?
372 Views
Last Modified: 2013-06-05
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
0
Comment
Question by:W.E.B
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
santoshmotwani earned 1000 total points
ID: 39224376
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
 

Author Comment

by:W.E.B
ID: 39224383
This did it, thanks
0
 

Author Closing Comment

by:W.E.B
ID: 39224385
Thanks
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question