Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Get Data Last 5 Days average data if value is less then 100000 Expand / Collapse
Author
Message
Posted Saturday, December 7, 2013 12:57 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Saturday, July 4, 2015 1:25 PM
Points: 42, Visits: 158
Hello Experts !

I have a data sheet attached as a sample...

In column B dates are placed, Column C having data, column D average data of last 5 days and column E having forcasted values.

My question i need a sql query which looks if the data in column C is less then column E ( 100000 value) then go to and get last previous 5 days values as average?

Tnx




  Post Attachments 
Avg.xlsx (14 views, 10.47 KB)
Post #1520793
Posted Monday, December 9, 2013 4:26 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: 2 days ago @ 10:50 AM
Points: 94, Visits: 742
farrukhhameed786 (12/7/2013)
Hello Experts !

I have a data sheet attached as a sample...

In column B dates are placed, Column C having data, column D average data of last 5 days and column E having forcasted values.

My question i need a sql query which looks if the data in column C is less then column E ( 100000 value) then go to and get last previous 5 days values as average?

Tnx




Maybe some friendly advice?

Not everyone is that comfortable opening up attachements and even then you word your question more like you're trying to get someone to do your work for you?
Maybe you post what you have tried and exactly where you are stuck, I bet you get better and more targeted help then.
Post #1521014
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse