Error Formatting of String

  • Hi

    In my application I have got a string field which stores money value or decimal values .

    ie Table T , Column name PBO

    one value is 1000000

    other value is 10/01/2008

    In my SSRS 2005 reports , the value 1000000 should appear as $1,000,000.00

    and if it 10/01/2008, then should display as 10/01/2008.

    I used the below code for that

    =IIF(ISNUMERIC(Fields!PBO.Value)

    , cstr(FormatCurrency(Fields!PBO.Value))

    , cstr(Fields!PBO.Value)

    )

    The result for Currency is as expected , but in the place of date, it displays as #Error?

    Any idea?

  • IIF evaluates both sides of the expression, so it is failing on the conversion to currency.

    I think you could use a REPLACE to remove the slashes in the currency conversion. Or, you could use two textboxes, one with each format and use the IIF expression to toggle the visibility.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply