Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
getur.srikanth@gmail.com
Yak Posting Veteran
77 Posts |
Posted - 2011-05-09 : 10:08:14
|
I need to find the maximum date for that particular client and store id, that will be treated as latest date (or current date). Then, From there I need to go back 52 weeks to 27 weeks and calculate sum(hours). And 26 Weeks to latest date (or current date) and calculate sum(hours).ClientID StoreID period hours1 10 2010-04-19 8.041 10 2010-04-20 6.241 10 2010-04-21 8.261 20 2010-04-22 7.941 20 2010-04-23 22.431 20 2010-04-24 22.992 5 2010-12-19 130.672 5 2010-12-26 159.262 5 2011-01-02 113.592 5 2011-01-09 12.662 8 2011-01-16 22.342 8 2011-01-23 11.35 Please let me know how to calculate this? If you have question ask me. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-05-09 : 10:14:31
|
| Duplicate: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=160301 |
 |
|
|
|
|
|