Searching using empty string or null 
Author Message
 Searching using empty string or null

I have a record in my .cdb database which contains a work_order_id = 1,
asset_id = a1, and procedure_id = "".  Im using this select statement to
find the record:

select * from tblwork where (work_order = 1 and asset_id = a1 and
(procedure_id = "" or procedure is null))

Running this query gives me a recordcount of 0.

I tried the following:
1)where(work_order = 1 and asset_id = a1)
    recordcount result = 1
2)where(work_order = 1 and asset_id =a1 and procedure_id = "")
    recordcount result  = 0
3)where(work_order = 1 and asset_id =a1 and procedure is null)
    recordcount result  = 0

Any ideas why I cant filter on empty string and/or null?



Tue, 30 Dec 2003 19:05:05 GMT  
 Searching using empty string or null
Looks like yew are 2 lame to be coding by'.  :)
Quote:
> I have a record in my .cdb database which contains a work_order_id = 1,
> asset_id = a1, and procedure_id = "".  Im using this select statement to
> find the record:

> select * from tblwork where (work_order = 1 and asset_id = a1 and
> (procedure_id = "" or procedure is null))

> Running this query gives me a recordcount of 0.

> I tried the following:
> 1)where(work_order = 1 and asset_id = a1)
>     recordcount result = 1
> 2)where(work_order = 1 and asset_id =a1 and procedure_id = "")
>     recordcount result  = 0
> 3)where(work_order = 1 and asset_id =a1 and procedure is null)
>     recordcount result  = 0

> Any ideas why I cant filter on empty string and/or null?



Tue, 06 Jan 2004 02:07:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Differences between NULL, Empty String, Null String?

2. Strange behaviour: nulls and empty strings

3. HELP: Empty strings and nulls!?!

4. Strange behaviour: nulls and empty strings

5. function to convert empty string to Null?

6. Null / Blank / Empty String Problems

7. Bound TextBox does not save an empty string to a null value

8. Empty String (in Access) to NULL (in SQL) via VB

9. policy on empty string, zero, and null

10. searching for empty fields in Access using VB4

11. Writing an empty string using RegSetKeyValueEx on NT corrupts registry entry

12. how to handle NULL values from a FORM when using date string functions - help please

 

 
Powered by phpBB® Forum Software