0
votes

There are a ton of posts on how to set the default date parameter in an SSRS report. I have tried many of the solutions, but I am still getting an error code of <Default Value 1> Value is not a date or time

My parameter's data type is Date/Time (The underlying field's data type is also a date)

I am currently using: dateadd("m",+3, today()) as the default value

I have tried several variations to include cdate, format, getdate(), today(), etc.

Any other ideas on how to format the default value for the parameter?

My goal is to set the default value to 3 months from today's date, but I am flexible on that for now as long as I can figure out how to set the default date, I can play with the syntax. The final goal will be to add 3 months to the end of the current month. Ie today is November 28, 2020, so my default will be the last day of February 2021.

Thanks, Brent

1

1 Answers

0
votes

I can't understand why this is not working other than a missing equals sign which I assume is just a typo? It looks fine and I've actually used the exact expression successfully.

NOTE: Make sure you do not have "Available values" set while you test. If you do then the problem is almost certainly that the exact datetime value generated by the default expression does not match one of the available expressions (e.g. 2020-02-28 vs 2020-02-28 00:00:00 )

Anyway, I've just setup a simple report, added a parameter with the following settings..

I've changed the expression slightly in case it helps and added some images so you can see exactly what I have where.

enter image description here

In the default Values tab...

enter image description here

I set the expression to ..

=DateAdd(DateInterval.Month, 3, Today())

enter image description here

If you still have problems, I suggest you create a new report test this to make sure it's not related to something else in your report design.