First and Last day of current month

reporting-services

In SQL Server Reporting Services; How can I calculate the first and last day of the previous month?

I know I can use the expression below to get the last day of the current month, but I'm stuck when trying to find the first and last of the previous month.

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

Best Answer

Just a guess based on your code working.

--previous month last
=DateSerial(Year(Now()), Month(Now()), "1").AddDays(-1)

--previous month first
=DateSerial(Year(Now()), Month(Now()), "1").AddMonths(-1)
Related Topic