March 16, 2015 at 12:45 pm
Hello All,
I've a SSRS monthly sales report with the sales details for current year and last year. I've 4 paramaters in the report. StartDate1, EndDate1, StartDate2 (hidden), EndDate2 (hidden).
For
StartDate1 - Beginning of Last month -
DateAdd(DateInterval.Month, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1)) (Will give me Feb 1 2015)
EndDate1 - End of Last month -
DateAdd(DateInterval.Minute, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1)) (Will give me Feb 28 2015)
StartDate2 - Need to get startdate as Feb 1 2014
EndDate2 - Need to get enddate as Feb 28 2014
Any help is greatly appreciated.
March 16, 2015 at 1:00 pm
This should work.
Any reason you are not doing this calc in SQL ?
=DATEADD(DateInterval.Year, -1, (DateAdd(DateInterval.Month, -1, DateSerial(Year(Now), Month(Now), 1))))
***SQL born on date Spring 2013:-)
March 16, 2015 at 1:38 pm
thomashohner- Thank you for your response. Quick question. I will still need to pass the dates in my paramters if I have the required dates in SQL. Isn't it? Thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply