SSRS Expression Help....PLEASE

  • Good morning,

    I have created a calculated field that I want to add to my report. What I am trying to do is return a field called AVGREV if it falls between 2 dates which will be passed in as parameters. What I intend to do is SUM the field AVGREV in the report. Please see the expression below. Still real new to this stuff and getting frustrated. Thanks in advance.

    =IIF(Fields!CSTRDT.Value >= FORMAT(Parameters!Parameter1.Value, "yyyyMMdd") AND Fields!CSTRDT.Value <= FORMAT(Parameters!Parameter2.Value, "yyyyMMdd"),(Fields!AVGREV.Value),0)

  • In the Dataset, get the column as a real datetime column. Then you won't have to waste time with that convert cr@p.

    The convert should be done only once in SSRS and only for display purpuses. Exactly for the problem you are experiencing.

  • OK, did that, Thanks. Now I am getting the following error.

    contains an error: Operator '>=' is not defined for type 'Decimal' and type 'Date'.

  • mbrady5 (9/12/2011)


    OK, did that, Thanks. Now I am getting the following error.

    contains an error: Operator '>=' is not defined for type 'Decimal' and type 'Date'.

    Hit google with this one. I can't remember but I know I have found that answer there.

Viewing 4 posts - 1 through 3 (of 3 total)

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