0

Report has two parameters

DateFrom
DateTo

DateTo set to "Always Refresh"

I have the following expression for DateTo - Default Values - so that it will dynamically default to the last of the month set by DateFrom

=DateSerial(Year(Parameters!DateFrom.Value), Month(Parameters!DateFrom.Value), "1").AddMonths(1).AddSeconds(-1)

However, the field doesn't update. It shows the correct last date of month when DateFrom is selected the first time.

If DateFrom is set to 15/02/2019 then DateTo will show "28/02/2019 23:59:59". But if you subsequently change DateFrom to a different month, DateTo doesn't update - still shows "28/02/2019 23:59:59".

Geezer
  • 513
  • 5
  • 17

1 Answers1

0

I have just added these Parameter properties 1) data type -> date/time and allow nulls 2) available values -> specify values -> label and value as

=DateSerial(Year(Parameters!Datefrom.Value), Month(Parameters!Datefrom.Value), "1").AddMonths(1).AddSeconds(-1)

3) Advanced=always refresh. and checked notify me box. This works the moment i change param 1 ('Datefrom') i get new dateto as last date from month.

Are your settings matching this?

D.Rane
  • 59
  • 9
  • this works in "Available values" but prevents the user from being able to change the date if so required. – Geezer Apr 26 '19 at 06:47