R
Randall Arnold
I've got a query in an Access data project that pulls in a 52-week range of
values. The date criteria is currently constructed as:
BETWEEN DATEADD(wk, - 53, DATEADD(wk, - 1, GETDATE())) AND DATEADD(wk, - 1,
GETDATE())
This would work fine if I wanted a constant 52 week rolling range from 7
days before the day the query is run. However, I want the query to always
start with the previous Friday, regardless of current weekday, and go back
52 weeks from there.
I've tried various combinations and settings of dateadd, datediff, etc and
so far can't come up with the necessary logic. Any help is appreciated.
Thanks,
Randall Arnold
values. The date criteria is currently constructed as:
BETWEEN DATEADD(wk, - 53, DATEADD(wk, - 1, GETDATE())) AND DATEADD(wk, - 1,
GETDATE())
This would work fine if I wanted a constant 52 week rolling range from 7
days before the day the query is run. However, I want the query to always
start with the previous Friday, regardless of current weekday, and go back
52 weeks from there.
I've tried various combinations and settings of dateadd, datediff, etc and
so far can't come up with the necessary logic. Any help is appreciated.
Thanks,
Randall Arnold