mutiple else ifnull in a formula?

    Date: 09/20/06 (SQL Server)    Keywords: no keywords

    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.

    Source: http://community.livejournal.com/sqlserver/52411.html

« ORDER BY clause in... || Verifying Basic SQL... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home