on 02-10-2015 9:35 PM
I have been asked to replace the start and end dates in my report to the (current date - 45 days) as the start date and (current date - 90 days) as the end date. I have pasted the first part of my query below. The line I have highlighted is the part I assume I need to change. Can anyone help?
with accts as (
select rmsfilenum,rmstrandte,
case when hstnewvalu in ('L18','P18') then 'daterqst'
when hstoldvalu in ('L18','P18') and hstnewvalu in ('L1A','P1A')
then 'dateappr'
when hstoldvalu in ('L18','P18') and not (hstnewvalu) in ('L1R','P1R')
then 'daterjct' end as datedata
from reporting.rhistfl
where rmstrandte between {?strtdt} and {?Enddt}
and rmstrancde = 'MT'
and rmsfldimpl = 'RMSSTATUS'
and (hstnewvalu in ('L18','P18')
or hstoldvalu in ('L18','P18') ) ),
Hi Dee,
The exact syntax will depend on your database. If you are using SQL Server your query would look something like:
where rmstrandte between dateadd (d, -45, GETDATE()) and dateadd (d, -90, GETDATE())
The dateadd function should give you the dates you want.
Good luck,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vendor Code errors are being passed from the database client through the report engine unmodified. E.g.; search your database documentation for the error, of google the error. One of many hits I get when I google 'Vendor code 204 DB 2' is:
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Ludek and Brian,
Thanks for the information and the link. I appreciate the help. And thanks again for responding to my post.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.