Skip to Content
0
Former Member
Feb 10, 2015 at 09:35 PM

Incorporating Current Date into Query.

60 Views

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') ) ),