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

Need to check for null

Status
Not open for further replies.

lbunch

Programmer
Sep 5, 2006
120
US
I am check for Past Due and Expired in teh @status field but what do I add for a check if there is not Past Due or Expired and @status is null. I am using Crystal 10 and @status is a date field... Thanks


If{@Status} = 'Past Due' then
{table.DOC2DDATE}
else if
{@Status} = 'Expired' then
{table.DOC2EDATE}
 
if not isnull(@status).


Always test for nulls first, because Crystal stops when it hits a null for any ordinary command.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I added the below but getting error "string is required"

If isnull {@Status} then
""
else
 
If the date field is of date datatype, then you would use:

if isnull({@Status}) then date(0,0,0) else
if {@Status} = 'Past Due' then
{table.DOC2DDATE} else
if {@Status} = 'Expired' then
{table.DOC2EDATE}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top