Joined: 11 Jul 2007
Location: United States
Online Status: Offline
Posts: 23
Topic: Report Formula problem Posted: 12 Jan 2009 at 2:49pm
I'm trying to set a formula in my report (Crystal 2003) to show that when a date is greater then or equal to 1/1/2009 OR if the field is NULL to print "LSE" else print "NOT". I'm having trouble with the following formula as it doesn't like the ISNULL:
IF {LeaseMaster.LeaseDispositionDate} >= DateTime (2009, 01, 01, 00, 00, 00) OR {LeaseMaster.LeaseDispositionDate} ISNULL THEN "LSE" ELSE "NOT"
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 20 Jan 2009 at 2:25pm
Actually, you should ALWAYS check for IsNull first. When you compare a null against a value, the result is null instead of True or False. Crystal, like SQL and most programming languages, will stop evaluating a boolean expression that contains "and" or "or" as soon as it gets a non-False value (which is not the same as a True value!) for a part of the expression. Since null is a non-False value you always want to look for nulls first.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum