Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
hjm35055
Partner - Contributor III
Partner - Contributor III

SQL query - rolling 3 years

Hi

I am working in Qlik Sense and connected to a SQL database. Does anyone know what my where clause would be to bring in the previous 3 years based off of the field "oe-date-ent" (not shown)?

Thank you!

Screen Shot 2018-10-23 at 4.33.10 PM.png

1 Reply
andrey_krylov
Specialist
Specialist

Hi Hannah, try this

Where [oe-date-ent] >= DATEADD(year, -3, GETDATE())

or this

Where Year([oe-date-ent]) >= Year(GETDATE()) -2