SSRS 2012 Expression builder Today() error
reporting-services, visual-studio-2012
Solution
The problem is that you are using SQL command syntax but Reporting Services uses VBA.
Even though the examples show `Today()` with the brackets after it, as if it was a method, that actually displays as a syntax error for me in the expression editor. Today's date is simply accessed like a property:
=Today
`DateAdd` exists but uses `DateInterval` properties, not the SQL `"m"` so six months ago is:
=DateAdd(DateInterval.Month, -6, Today)
Problem
I have two SSRS Parameters, Date/Time type: BeginDate and EndDate. I want them to default to EndDate=Today() and BeginDate=Today()-six months. Using Report Parameters, Default Values, I add a value and create the function =Today() but I get the red squiggly line under the parens. If I select the function from the Category list and double click it into the "Set Expression for:Value" box, I get the function with a single open-paren and the red squiggly which remains if I close off with a close-paren. I get the same error if (following the example in the "Example" section, for crist's sake) of =DateAdd("m", -6, Today()) I get the same error instead of a date six months prior. A little help please...? Thanks