SQLTeam.com | Weblogs | Forums

Nested IF

IF isnull({PMMilestonesWIP.EstPoscomplete}) then ''
else (if {PMMilestonesWIP.EstPoscomplete} = 1 then {PMMilestonesWIP.StakeEnd}
else {tblCustomers.Pos_Date})

I'm using this as a field in crystal reports and I can not get it to work.
I have tried this a dozen ways and I am running out of ideas.

It gives me errors with wanting strings or dates.

FYI SQLTeam.com is a Microsoft SQL Server focused site, we're not experts on Crystal Reports.

That being said, I assume you're getting some kind of conversion error message, because if StakeEnd or Pos_Date are date fields, you can't return an empty string in the first IF condition. You'll have to either cast both StakeEnd and Pos_Date as strings, or have the first IF return NULL, and use the formatting options to display NULL as blank.