none
setting a data-driven subscription in SSRS to be a parameter for a date/time variable. RRS feed

  • Question

  • I am setting a data-driven subscription in SSRS with what I hope to be a parameter for a date/time variable.  The business requirement is that I pass a Parmenter to the report that needs to be set to yesterday's date from when the subscribed email alert is sent.

    This is a query I am using in a data-driven subscription in SSRS. How to I make the following SQL query return  the previous date instead of the current system date:

        SELECT CONVERT (date, SYSDATETIME()) as rundate

    Monday, February 11, 2019 11:58 PM

All replies

  • I am setting a data-driven subscription in SSRS with what I hope to be a parameter for a date/time variable.  The business requirement is that I pass a Parmenter to the report that needs to be set to yesterday's date from when the subscribed email alert is sent.

    This is a query I am using in a data-driven subscription in SSRS. How to I make the following SQL query return  the previous date instead of the current system date:

        SELECT CONVERT (date, SYSDATETIME()) as rundate

    Monday, February 11, 2019 11:49 PM
  • SELECT

    convert(date,DATEADD(DAY,-1 ,SYSDATETIME()))asrundate

    • Proposed as answer by Eric Liu001 Wednesday, February 13, 2019 6:15 AM
    Tuesday, February 12, 2019 12:44 AM
  • Hi Bobby Lawrence

    You could use the query like below :

    SELECT CONVERT (date, dateadd(Day,-1,SYSDATETIME())) as rundate


    Hope it can help you .

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    • Proposed as answer by Eric Liu001 Wednesday, February 13, 2019 6:15 AM
    Tuesday, February 12, 2019 2:24 AM