Expression tweak in a date parameter

  • In SSRS I am currently using this expression:

    =IIF(Today() >= DateSerial(Year(Today()), 4, 1),DateSerial(Year(Today()), 4, 1), DateSerial(Year(Today()) - 1, 4, 1))

    In a date parameter (default values, specify values). This gives me 01/04/2018.

    However for one particular report it would be helpful for the date to default to the previous year - e.g. 01/04/2017.

    I've tried to tweak the above expression to make this work, but haven't succeeded. Can this expression be changed to go back one year?

    Thanks.

  • faulknerwilliam2 - Wednesday, August 22, 2018 4:41 AM

    In SSRS I am currently using this expression:

    =IIF(Today() >= DateSerial(Year(Today()), 4, 1),DateSerial(Year(Today()), 4, 1), DateSerial(Year(Today()) - 1, 4, 1))

    In a date parameter (default values, specify values). This gives me 01/04/2018.

    However for one particular report it would be helpful for the date to default to the previous year - e.g. 01/04/2017.

    I've tried to tweak the above expression to make this work, but haven't succeeded. Can this expression be changed to go back one year?

    Thanks.

    Used: =IIF(Today() >= DateSerial(Year(Today()), 4, 1),DateSerial(Year(Today())-1, 4, 1), DateSerial(Year(Today())- 2, 4, 1))

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

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