I am working on a query in which I have to retrieve the last 12 months, based on a field named "weekending"
There is some data with dates in the future that i really do not want to look at.
FROM OE_DATA r
where r.weekending > DATEADD(ww, -12, current_timestamp)
group by r.weekending
order by r.weekending ASC
How can a clause be added so that the weekending field is 12 months in the past but no greater than weekending of current week.
Thanks a lot for your help.