4

I am trying

select * from table where Contact Is Not null 

but it is displaying values including empty values

Vampire
  • 320
  • 1
  • 4
  • 10

2 Answers2

1

Your query is correct but probably you have zero length strings in your Contact column. You can use

select * from table where len(Nz(Contact, '')) > 0

The Nz function returns the specified default value if the column is null.

Barry
  • 3,683
  • 1
  • 18
  • 25
  • @Vampire I would recommend taking a read through http://allenbrowne.com/vba-NothingEmpty.html it was a great read to learn more about Null's, Nothing's, and Empty strings. – Newd Jun 16 '15 at 12:34
0

You can try like this:

select * from table where Len([Contact] & "")>0 
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331