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.

 All Forums
 Development Tools
 Reporting Services Development
 How to get 4 weeks average

Author  Topic 

escape
Starting Member

3 Posts

Posted - 2006-09-15 : 06:32:44
i have 3 tables, each with a date(daily dates) column(column name is same in all tables)
Each table has columns say "value1","value2", "value3"

i want data from all these tables together.such that my first column will have data weeks and count1,count2,count3 will have average of next 4 weeks count..placed infront of week.

weeks count(value1) count(value2) count(value3 )
1/1/2005 101 88 221
1/8/2005 100 81 151
1/15/2005 87 96 301

Average calculations Here :
week 1 2 3 4
Count1: 101 = ( 99 + 105 + 110 + 87 )/4
100 = (105 + 110 + 87 + 98 )/4


Plz lemme know if u have any suggestions..

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-15 : 07:01:12
Duplicate post
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72059


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -