Quantcast
Channel: Toad Data Point Forum - Recent Threads
Viewing all articles
Browse latest Browse all 2544

Help with creating your own From and To dates

$
0
0

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] BETWEENdateadd (wk, -6, GetDate ())

ANDdateadd (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.

David


Viewing all articles
Browse latest Browse all 2544


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>