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

Return blank in if statement

Status
Not open for further replies.

gallant09

Technical User
Dec 3, 2009
2
US
I'm try to return a blank if the value is <0 in the following formula. I can get it to return "0", but if I put "" in the TRUE spot, the formula errors out.

IIF (datediff("d",{PJM_MASTER__JOB_CUSTOM_FIELDS.Final_Complete},
if isnull({PJM_MASTER__JOB_CUSTOM_FIELDS.Punchlist_Signoff}) then
currentdate else {PJM_MASTER__JOB_CUSTOM_FIELDS.Punchlist_Signoff})<0,0,datediff("d",{PJM_MASTER__JOB_CUSTOM_FIELDS.Final_Complete},
if isnull({PJM_MASTER__JOB_CUSTOM_FIELDS.Punchlist_Signoff}) then
currentdate else {PJM_MASTER__JOB_CUSTOM_FIELDS.Punchlist_Signoff}))
 
Crystal won't allow mixed data types in the results of an if then...

One way to handle this is let the result be 0. Then format the field to supress zero's. Format Field, Customize, and check the Supress if Zero box.

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top