Friday, June 21, 2024

SSRS - How to get first and last day in month

These are useful functions, for example for parameter filling:

First and last day of this month:
=dateadd("m",0,dateserial(year(Today),month(Today),1))
=dateadd("m",1,dateserial(year(Today),month(Today),0))
First and last day of last month:
=dateadd("m",-1,dateserial(year(Today),month(Today),1))
=dateadd("m",0,dateserial(year(Today),month(Today),0))
First and last day of next month:
=dateadd("m",1,dateserial(year(Today),month(Today),1))
=dateadd("m",2,dateserial(year(Today),month(Today),0))

No comments:

Post a Comment