How to get the month end date in SSRS

Posted on 2011-04-26
Last Modified: 2012-05-11
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
Question by:prashant04
    LVL 3

    Expert Comment

    This site has a few tricks for this sort of thing: Extended date functions
    LVL 4

    Accepted Solution

    here it is, which will return last day of current month.

    dateadd(dd,-1,dateadd(mm,datediff(mm,0,dateadd(mm, 1, getdate())),0))
    LVL 4

    Expert Comment

    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]


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

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now