• sanju2t (9/27/2012)


    Hi,

    I have a report where countrycode is a paramater and i need to show the date format as dd/MM/yyyy on basis of countrycode. Can someone help me know how can i simplify the statetment for the condition?

    In Pseudo code:

    If countrycode in ("AU", "NZ", "IN", "MAL")

    then

    endDate.Format("dd/MM/yyyy")

    else

    endDate.Format("MM/dd/yyyy")

    end if

    I need to write somewhat the same for my report (.rdl) file.

    Thanks

    Susheel

    a case statement is your friend

    case when countrycode in ("AU", "NZ", "IN", "MAL") then convert(varchar(12),[datecolumn],101)

    else convert(varchar(12),[datecolumn],103)

    end

    *code may take some tweaking