SQL query selecting null values 
Author Message
 SQL query selecting null values

You can save me a couple of days experimenting with answering this:

When I run an SQL query and I would like to choose the records that do not have
a value in a field, I end up selecting NO records at all.

My application will take an address from one record and then browse anyone
living at the same address.

eg
mUnit  =  Table1!Unit
mHouse = Table1!House
mStreet = Table1!Street
SELECT * FROM Database WHERE Unit = mUnit AND House = mHouse AND Street =MStreet

If every field is filled I get the correct result. If there is no value eg no
unit number I get zilch.

I figure this is a basic VB question but have tried experimenting for too long
now.

Thanks in advance.

Darryl



Thu, 02 Dec 1999 03:00:00 GMT  
 SQL query selecting null values

Quote:
>When I run an SQL query and I would like to choose the records that do not have
>a value in a field, I end up selecting NO records at all.

To find values that are null use this syntax:

select * from yourtable where unit is null

-- Jim Ferguson, FMS
   http://www.fmsinc.com



Thu, 02 Dec 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. NULL Values in SQL Queries - HELP!

2. NULL Values in SQL Queries - HELP HELP

3. Multi-select list box, null value

4. How to select cols with null value

5. Movenext fails when select contains duplicated columns with null values

6. Movenext fails when select contains duplicated columns with null values

7. SQL query: from SELECT statement to stored procedure with dynamic PL/SQL

8. How to pass single, multiple or null parameter value(s) to multiple queries

9. Parameter Query/Null Value help

10. Paramter Query/Null Value help

11. Null values in Parameter queries (or Wildcards)???

12. Null values in Parameter queries (or Wildcards)???

 

 
Powered by phpBB® Forum Software