AND dateadd (wk, -2, GetDate ()))
Group By used to return one row of data, so a date is not included in the output.
To display a From and To dates in my report I thought of creating two calculated fields.
FromDate - with expression
dateadd (wk, -6, GetDate ())
ToDate - with expression
dateadd (wk, -2, GetDate ())
However when I tried creating the FromDate calculated field I received the error message “The specified expression contains invalid symbols (line 1, character 22).”
Which is the closing bracket of the GetDate…
I have even tried changing GetDate() to Today().
dateadd (wk, -6, Today ())
This saved OK in the Expression Editor with no error message. But after placing this calculated field at ReportHeaderBand1 level in my report nothing is displayed when Previewed.
Any help and advise welcome.
Thank you in advance.
I have an SQL script (database is SQL Server) that filters four weeks of data by including the following in the Where clause
([PLTC].[Week Ending] BETWEEN dateadd (wk, -6, GetDate ())