how do i get the previous month last day based on a parameter value?


I have a parameter report date based on that report date i habe a text box that says "Previos A/R amount "this is where I need the last day of the previous month based on that parameter. The code that I have not quite working. It still gives me the same month that the user selects not the previous.
="Previous Months A/R:" & " " & "(as of" & " " &DateSerial(Year(Parameters!ReportDate.Value),Month(Parameters!ReportDate.Value)-2,Day(Parameters!ReportDate.Value)) &")"


SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,826 questions
0 comments No comments
{count} votes

Accepted answer
  1. AniyaTang-MSFT 12,331 Reputation points Microsoft Vendor

    Hi @Jannette Jones
    Do you mean that you want to calculate the last day of the previous month for the date of the parameter report date? Then you can use this expression:

    ="Previous Months A/R:" & " " & "(as of" & " " &DateAdd("d", -1, DateSerial(Year(Parameters!ReportDate.Value), Month(Parameters!ReportDate.Value), 1)) &")"  

    Best regards,

0 additional answers

Sort by: Most helpful