troubleshooting Question

Dealing with NuLL Values returns no data

Avatar of Becky Edwards
Becky EdwardsFlag for United States of America asked on
Microsoft SQL ServerSQL
15 Comments1 Solution92 ViewsLast Modified:
I want to filter out patients who have a 1, or a 2 in the following field, leaving patients who either have a NULL value or any of the other values.

When I put in this filter
pt.PATIENT_TYPE_C not in (1,2) 
it doesn't return anyone because the patients currently have all NULL values in that field.

PATIENT_TYPE_C      NAME
1      Anonymous
2      Confidential
3      Employee
4      Dismissed
5      Verified with no Medicare
6      Prisoner
7      VIP

How can I write my filter to account for the NULL value?
ASKER CERTIFIED SOLUTION
Éric Moreau
Senior .Net Consultant
Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros