SSRS – How to set a default parameter to the first day of the month

Just enter one of these expressions into the default parameter box when you’re setting up parameters in SQL Server Reporting Services:

=DateSerial(Year(Now), Month(Now), 1) for first day of the month and
=DateSerial(Year(Now), Month(Now)+1, 0) for the last day of the month.

Source

One Response to “SSRS – How to set a default parameter to the first day of the month”

  1. Jody says:

    We normally go to the trouble of setting up a second data set and running select on these kinds of things…

    First of This Month:
    SELECT CAST(CONVERT(char(6),GETDATE(),112) + ‘01′ as datetime)

    First of Next Month:
    SELECT CAST(CONVERT(char(6),dateadd(mm, 1, GETDATE()),112) + ‘01′ as datetime)

    Then referencing those in the parameter. Just another way to do it.