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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Records with NULL Data Excluded from Query

Status
Not open for further replies.

Sean466

Programmer
Mar 27, 2003
12
CA
Hi,

I have a query like the following:

TABLE FILE PROJECTS
PRINT
PROJECT_NUMBER
WHERE PROJECT_NUMBER EQ '1234'
WHERE (STAT_CD NE '201')
END

Suppose there is one record in table PROJECTS where PROJECT_NUMBER = '1234', and STAT_CD is NULL for that record.

The above query will not qualify the record properly, ie, 0 records are returned.

But if I change the second WHERE clause to
WHERE (STAT_CD NE '201' OR STAT_CD IS MISSING)
then my query returns the record.

My question is....
Is there a global setting whereby my original query would return the record. I don't want to have to add the part 'OR STAT_CD IS MISSING' explicitly to my query.

Thanks!
Sean

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top