• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 749
  • 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

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

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