Link to home
Start Free TrialLog in
Avatar of prashant04
prashant04Flag for India

asked on

How to get the month end date in SSRS

How to get the current month end date in SSRS ir-resepective of month date

Ex: if today is 26-0-2011 then result should be 30-04-2011
Avatar of kraiven
kraiven

This site has a few tricks for this sort of thing: Extended date functions
ASKER CERTIFIED SOLUTION
Avatar of malikirfan28
malikirfan28

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
instead fo "getdate()" you can give any date to get its month end day.

for example

select  dateadd(dd,-1,dateadd(mm,datediff(mm,0,dateadd(mm, 1, '6/20/2011')),0)) [LastDate]

OR

select  dateadd(dd,-1,dateadd(mm,datediff(mm,0,dateadd(mm, 1, '5/20/2011')),0)) [LastDate]