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

Null field can't be evaluated

Status
Not open for further replies.

dgr01

IS-IT--Management
Apr 9, 2003
17
US
Using the formula below in Crystal Reports 9.2.2, I’m trying to evaluate if a text field in a SQL server table is Null, but it is it’s not returning any value at all when it is blank. When I try to do this evaluation on another similar text field in another table in the database, it works fine. I’m pretty sure there are no blank spaces in the field as well.

{EligibilityRequests.PCPName} = "Null"

When there is a value in the field, the formula above returns FALSE. When it is blank or null, the function returns nothing.

I also tried to evaluate the length thinking it should return 0 but it also returns nothing.

how can a text field not return no value at all if blank?
Any thoughts out there?
Thanks, Dgr
 
Hi,
Try one of these:

Trim({EligibilityRequests.PCPName}) = ""

Or

IsNull({EligibilityRequests.PCPName})

[profile]
 
IsNull worked, how i missed that one i'll never know.
Thanks a lot for your help!
Dgr
 
Using Crystal, you're bound to run into trouble with Null again. I did: I came to Crystal from mainframe languages and got a 'cultural shock' when encountering null.

Null means 'no data': Mainframe languages mostly treat this as the same as zero or space. It is actually a finer shade of meaning, the difference between 'Yes, we have no bananas' and 'I don't know how many bananas we have, it could be some, it could be zero'. In Crystal, the entry is 0 or null and can be tested for.

Note that Crystal assumes that anything with a null means that the field should not display. Always begin with something like
Code:
if isnull({your.amount}) then 0 
		         else {your.amount}

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top