Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Null Values in SQL Statement

Status
Not open for further replies.

JimReiley

MIS
Dec 10, 2004
58
US
I have a field in a record that is defined as a 4 byte date in the ddf's. How do I select records that donot contain any information in the field? Are they nulls?

 
put this condition in the where clause of your sql statement...

WHERE yourfield IS NOT NULL

-DNG
 
Actually, it depends on your how the field is defined as well as what's actually in the field.
- When were these tables/DDFs created?
- Do they have a "True Null" byte?
- The IS NOT NULL may work unless the engine doesn't see the values as NULL.
- What do these empty dates look like in the PCC?
- What do these empty dates look like in the Function Executor (byte values)?


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
is null and is not null both work fine.

When the ddf's were originally created for this table, the flag 'nullable' was not checked. This morning I changed the definition to 'nullable' = y and reloaded the data into the table. I don't know if that made any difference or not.

When you look at this field in the PCC, the fields either show a date string or nothing. I havn't looked at them in the function executor.

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top