Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for Null value in DB2
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00552608
Message ID:
00552672
Views:
13
This message has been marked as the solution to the initial question of the thread.
>I am using embedded SQL statements in Visual Basic 6 to query data from a DB2 database. The field I am trying to check and see if it's value is Null is Cancel_date, it is a date/time field.
>I don't know how to write the Select statement so that it checks if it's value is Null. I tried:
>
>SELECT * FROM TableName WHERE CANC_DT = NULL
>SELECT * FROM TableName WHERE CANC_DT = 'NULL'
>SELECT * FROM TableName WHERE CANC_DT = ""
>
>none of these work, does anyone know how to do this?
>thanks,
>Ryan Uhl

Normally, you use the IS operator:
SELECT * FROM TableName WHERE CANC_DT IS NULL
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform