Top.Mail.Ru
? ?
SQL Server's Journal

> recent entries
> calendar
> friends
> microsoft.com/sql
> profile

Wednesday, September 20th, 2006
1:36p - mutiple else ifnull in a formula?
hello,

i have a question regarding a Crystal Reports formula i'm attempting. this is the only community that seems applicable when searching in interest "crystal reports", but if you know of a better place for me to ask this, please direct me there.

anyway, my issue is this. i have 3 date fields. if only the 1st one is populated, i want the output to be "date field 1". if both the 1st and 2nd fields are populated, i want the output to be "date field 1" and "date field 2". if all 3 fields are populated, i want the output to be "date field 1", "date field 2" and "date field 3".

here is the formula i have right now. i've played around a lot with parenthese placement, and everything has generated errors so far. the formula date fields are just a ToText conversion of the date fields, as i thought text would work better in the concatenation.

If (isnull({datefield2})) then ({datefield1})
else if (isnull({datefield3})
then ({formuladatefield1}+" and "+{formuladatefield2})
else ({formuladatefield1}+", "+{formuladatefield2}+" and "+{formuladatefield3})

any help is appreciated. thanks in advance.


current mood: Image frustrated

(10 comments |comment on this)


<< previous day [calendar] next day >>
> top of page
LiveJournal.com
Image