Date Filter help required in SQL Posted July 26, 2019 Hi, I want to be able to filter by date looking back 6 months. I then want to include data from 12 months, 18 months, 24 months etc How would i do this without having to repeat myself? Currently i am using the below and then repeating it e.g between dateadd(dd,-189,getdate()) and dateadd(dd,-183,getdate()) between dateadd(dd,-373,getdate()) and dateadd(dd,-366,getdate()) Thanks in Advance,
Date Filter help required
in SQL
Posted
Hi,
I want to be able to filter by date looking back 6 months. I then want to include data from 12 months, 18 months, 24 months etc
How would i do this without having to repeat myself? Currently i am using the below and then repeating it
e.g
between dateadd(dd,-189,getdate()) and dateadd(dd,-183,getdate())
between dateadd(dd,-373,getdate()) and dateadd(dd,-366,getdate())
Thanks in Advance,