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!

is null

Status
Not open for further replies.

needmoremoney

Technical User
Mar 30, 2005
123
US
I have this:

//WhilePrintingRecords;
//
//if CurrentDate() > {EInfo.ee401kEligibleDate}
// Then totext ({temp401KReport.ytdGross}, "000000000.00")
// else "000000000.00"


When the Einfo.ee401kEligibleDate is null, i get no outputs. What could be wrong? Thanks for any help.
 
You need to use the Isnull function:

WhilePrintingRecords;

if not (isnull({EInfo.ee401kEligibleDate})) and CurrentDate() > {EInfo.ee401kEligibleDate} Then
totext ({temp401KReport.ytdGross}, "000000000.00")
else
"000000000.00"

~Brian
 
Brian............

You are a life saver......!!!!!!!

It works.. thanks a million..
 
Question though:

In plain english, when inputting the "if not (isnull ...)"
what does that state?

example: It cannot be blank else.. this will happen..
 
The isnull(table.field) is evaluated first and will return either a true or false. The Not() simply reverses the value


So if you have a valid date, the isnull() would be false and the Not() would change that to true and assign the value, totext ({temp401KReport.ytdGross}, "000000000.00")

-LW
 
Having come to Crystal from mainframe languages, I got a 'cultural shock' when encountering null. It means 'no data': Mainframe languages mostly treat this as the same as zero.
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.

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

Part and Inventory Search

Sponsor

Back
Top