• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 755
  • Last Modified:

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
0
prashant04
Asked:
prashant04
  • 2
1 Solution
 
kraivenCommented:
This site has a few tricks for this sort of thing: Extended date functions
0
 
malikirfan28Commented:
here it is, which will return last day of current month.

dateadd(dd,-1,dateadd(mm,datediff(mm,0,dateadd(mm, 1, getdate())),0))
0
 
malikirfan28Commented:
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]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now