I have build an SSRS report. I set a default date parameters as following: startdate : take the first day of the month. EndDate : take yesterday date.
This code for the beginning of the month
=DateSerial(Year(Now()), Month(Now()), "1").AddMonths(0)
This code for yesterdate date
=DateAdd(DateInterval.Day,-1,CDate(FormatDateTime(Now,DateFormat.ShortDate)))
The date works perfectly until, a new month comes, the result will be like this: startdate: 01. 5 2019 end date: 30. 4 2019
where it should be : startdate: 01. 4 2019 end date: 30. 4 2019
how can i make sure if a new date comes , it will take the first day of the previous month.