Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Report Formula problem Post Reply Post New Topic
Author Message
Krazy Kasper
Newbie
Newbie
Avatar

Joined: 11 Jul 2007
Location: United States
Online Status: Offline
Posts: 23
Quote Krazy Kasper Replybullet 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"

Appreciate any assistance.

 Krazy (Bill) Kasper

Krazy Kasper
IP IP Logged
AntDC
Groupie
Groupie
Avatar

Joined: 23 Dec 2008
Online Status: Offline
Posts: 76
Quote AntDC Replybullet Posted: 13 Jan 2009 at 4:13am
Use the Crystal IsNull function........

IF ({LeaseMaster.LeaseDispositionDate} >= DateTime (2009, 01, 01, 00, 00, 00)
OR  IsNull{LeaseMaster.LeaseDispositionDate})
THEN "LSE"
ELSE "NOT"
IP IP Logged
Krazy Kasper
Newbie
Newbie
Avatar

Joined: 11 Jul 2007
Location: United States
Online Status: Offline
Posts: 23
Quote Krazy Kasper Replybullet Posted: 13 Jan 2009 at 6:26am
Thank you.
Krazy Kasper
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet 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.
 
-Dell
IP IP Logged
Krazy Kasper
Newbie
Newbie
Avatar

Joined: 11 Jul 2007
Location: United States
Online Status: Offline
Posts: 23
Quote Krazy Kasper Replybullet Posted: 21 Jan 2009 at 5:24am
Thanks Dell.
Krazy Kasper
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.031 seconds.