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!

Displaying a value in a blank field 1

Status
Not open for further replies.

gscheepers

IS-IT--Management
Jan 21, 2002
150
US
Hi everyone,

I'm having problems with the following formula:

If date({EMPLOYEEJOB.End}) > {?End Date} or isnull({EMPLOYEEJOB.End})
then {?End Date} else
date({EMPLOYEEJOB.End});

I'm trying to display the {?End Date} if {EMPLOYEEJOB.End} > {?End Date} or if there's no value in the {EMPLOYEEJOB.End} field. When I use the formula above, it does not display the {?End Date} value where there's no value, but keeps it blank in stead.

Your help would be appreciated!

Many thanks, Gerhard Scheepers

"Great souls have wills; feeble ones only wishes..."
 
Perhaps the field is never null, try:

If isnull({EMPLOYEEJOB.End})
or
date({EMPLOYEEJOB.End}) > {?End Date}
or
date({EMPLOYEEJOB.End}) < date(1920,1,1) then
// this last being a sanity check against the date
{?End Date}
else
date({EMPLOYEEJOB.End})

I've read that Crystal sometimes ignores the isnull() test if it isn't first in the set of tests, so I changed the order.

-k kai@informeddatadecisions.com
 
Thanks! That worked great!
Gerhard Scheepers

&quot;Great souls have wills; feeble ones only wishes...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top