• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3616
  • Last Modified:

How to filter empty and null values on a query ?

HI
I need to perform a query comparing a field agaist NULL and empty values, something like:

if ID_EMPLOYEE is not NULL or is NOT empty then....

How to do that ?

Thanks in advance
0
dimensionav
Asked:
dimensionav
1 Solution
 
Nathan RileyFounderCommented:
select isnull(ID_EMPLOYEE)
from table
0
 
BrandonGalderisiCommented:
What DB Engine?

SQL Server:

select *from SomeTable
where nullif(id_employee,'') <> ''

or

select *from SomeTable
where id_employee is not null
and len(id_employee)>0
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now