locked
Default param should alway be every 5th day of the current month RRS feed

  • Question

  • Hi Guys,

    I have an SSRS report that need to run every 5th of the current month.

    need my parameter date the default date should always be every 5th day of the current month.

    Declare @Startdate datetime
    Set @Startdate='2012/12/05'


    • Edited by Lenoj Thursday, November 29, 2012 5:11 AM edit
    Thursday, November 29, 2012 3:46 AM

Answers

  • Otherwise if you want to do it the first way you suggested, put this as your default value in your date parameter

    =DateSerial(Year(Now), Month(Now), 5)

    • Marked as answer by Lenoj Thursday, November 29, 2012 5:27 AM
    Thursday, November 29, 2012 5:24 AM

All replies

  • What is your question?
    Thursday, November 29, 2012 5:11 AM
  • need my default date parameter will always be on the 5th day of the current month.
    Thursday, November 29, 2012 5:13 AM
  • Hi Lenoj,

    Try this,

    DECLARE @StartDate DATETIME

    SET @StartDate =  DATEADD(dd,4,DATEADD(mm,DATEDIFF(mm,0,GetDate()),0))

    Hope this helps.

    Thursday, November 29, 2012 5:21 AM
  • Why dont you set your default date parameter to always be today, and then set up a report schedule so that it only gets scheduled to run on the 5th of each month.

    When it gets run it will get the date as the fifth each time because thats when it gets run.

    Thursday, November 29, 2012 5:22 AM
  • Otherwise if you want to do it the first way you suggested, put this as your default value in your date parameter

    =DateSerial(Year(Now), Month(Now), 5)

    • Marked as answer by Lenoj Thursday, November 29, 2012 5:27 AM
    Thursday, November 29, 2012 5:24 AM
  • Thenks CLareMoore.

    This is what im looking for. Anyway , if my default is my parameter is like this, how do i setup in my subscription. I'll go to monthly ------> then on week of month will be 1st? please let me know. thanks again.

    Thursday, November 29, 2012 5:32 AM
  • Hi Lenoj,

    To run the subscription on the 5th day of each month, you can select "Month", and set the "On Calendar Days(s)" to "5". Please see the screenshot below:

    Hope this helps.

    Regards,


    Mike Yin
    TechNet Community Support

    Monday, December 3, 2012 10:33 AM