Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL 2008 SELECT

Posted on 2013-06-05
3
Medium Priority
?
370 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 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