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!

if...then...else to result in 0

Status
Not open for further replies.

Crystalguru

Technical User
Oct 4, 2001
303
US
I have a formula that is:
if {Comments.TimeStamp} in date(2002,12,01) to date(2002,12,31) and
({Comments.Action}like "Close - Leased*"
or {ILT_Comments.Action}like"Close - Leased with another*" )
then
1
else
0

This formula is working for the fields that meet the condition. It returns a 1. It also works for fields that do not meet the criteria - 0(zero). Due to a left outer join, some fields do not have anything in the Comments table (null). I have tried the if isnull(comments.ID) then 0, but it doesn't return the 0(zero).

Any ideas?

thanks
 
Make you null test the very first line of code. Crystal chokes on null data and will never get to teh rest of teh code.

Another alternative is under file, options, make sure the "convert null field value to default" option is checked.
Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Ah yes, the order... seems that also happens in the record selection criteria!

thanks for your help..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top