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

Counting NULL Fields

Status
Not open for further replies.

TEM3

Technical User
Dec 6, 2004
324
US
Using CR 8.5 and Oracle 9i tables:

I have a table field {ALL_ASSIGNMENTS.Report Format} that can contain a specific text value or is NULL. I can count all the records matching specific data, but the NULL fields are either ignored or give bogus numbers. I have tried with and without the Report Format replace NULLS thing, tried testing for trim({ALL_ASSIGNMENTS.Report Format}) = "", ISNULL({ALL_ASSIGNMENTS.Report Format}), {ALL_ASSIGNMENTS.Report Format} <> "Specific Text", etc. Nothing seems to give a realistic number.

Any other suggestions please?
 
Null is not the same as trim({table.field}) = ""

Try reading up on nulls.

A quick cheat for this would be to create a formula such as:

if isnull({table.field}) then
1
else
0

Perhaps you want blanks or nulls included in the count, so try:

if isnull({table.field})
or
trim({table.field}) = ""
then
1
else
0

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top