Date Expression - calculate a month

  • I have two parameters for date, @Report_From_Date and @Report_To_Date. I want to set their default values to latest Month. So for my @Report_From_Date default value I have

    =DateSerial(Year(Now()), Month(Now()), "1")

    and @Report_To_Date I have

    =DateSerial(Year(Now), Month(Now), "1")

    . this as a results it gives me the 1st of October, but I want to get the 1st of every month to the last day of that month. help.

  • Just subtract one day from the first day of the next month.

    -- Gianluca Sartori

  • Thank you, this what I did

    =DateSerial(Year(Now), Month(Now), "1").AddMonths(1).AddDays(-1)

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

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