Need Expression to subtract year

  • Hello,

    How to subtract the year to -1 in SSRS

    I have the parameter called year, suppose id I give value as 2011

    In the detail section on report designer I should see as 2010

    I dragged a text box and named as year and I dragged another textbox and trying to write expression as like = paramters!year.value-1

    Its giving error

    Any help....

  • What type is the parameter? Should be an integer. then you can do something like

    =Parameters!EndWeekNo.Value + 1

  • mcfarlandparkway (6/2/2014)


    Hello,

    How to subtract the year to -1 in SSRS

    I have the parameter called year, suppose id I give value as 2011

    In the detail section on report designer I should see as 2010

    I dragged a text box and named as year and I dragged another textbox and trying to write expression as like = paramters!year.value-1

    Its giving error

    Any help....

    What's the error?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Your Parameter should be of Date Type, the below would help.

    =DATEADD (DateInterval.Year, -1, Today())

    If not, use CDATE and convert it to Date and then Use above.

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

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