SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Get Data Last 5 Days average data if value is less then 100000


Get Data Last 5 Days average data if value is less then 100000

Author
Message
smer
smer
Old Hand
Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)

Group: General Forum Members
Points: 390 Visits: 219
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
Attachments
Avg.xlsx (31 views, 10.00 KB)
CKX
CKX
SSChasing Mays
SSChasing Mays (604 reputation)SSChasing Mays (604 reputation)SSChasing Mays (604 reputation)SSChasing Mays (604 reputation)SSChasing Mays (604 reputation)SSChasing Mays (604 reputation)SSChasing Mays (604 reputation)SSChasing Mays (604 reputation)

Group: General Forum Members
Points: 604 Visits: 1033
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search