Search code examples
reporting-servicesparametersexpressionssrs-2012reporting-services-2012

Expression For Last Day of January in Current Year


I want to know what expression what I use to find specifically the last day of the month of January for the current year. Can anybody help me with this specific expression in SSRS? Trying to use for a parameter value.

Thanks!


Solution

  • That can be as simple as something like this:

    =CDate("1/31/" & DatePart(DateInterval.Year, Today))
    

    You may need to change this a bit depending on the date format of where you live. This one above would be fine anywhere in the US.

    =CDate("31/01/" & DatePart(DateInterval.Year, Today)) 
    

    This one could be best for Europe.

    =CDate(DatePart(DateInterval.Year, Today) & "-01-31")
    

    Above works, too.

    Play around with the idea. Hope this helps.