Avatar of metropia
metropia
Flag for United States of America asked on

query that looks back 12 weeks

In my query, I need to look at the last 12 week ending dates, or 12 months in the where clause. Could anyone help me out adding this clause?

My query:

select week_ending as 'Week Ending', 
          convert(decimal(10,2),
          avg(roll_change_time)) as 'Average Roll Change Time' 
from roll_change_data
group by week_ending

Open in new window



Thank you much.
Microsoft SQL ServerSQL

Avatar of undefined
Last Comment
metropia

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
sventhan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
metropia

ASKER
thank you, and how to get the last 12 weeks?
SOLUTION
venk_r

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
metropia

ASKER
thank you guys!
Your help has saved me hundreds of hours of internet surfing.
fblack61