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
 General SQL Server Forums
 New to SQL Server Programming
 accumulating data and transfer

Author  Topic 

shan1430
Yak Posting Veteran

86 Posts

Posted - 2008-04-03 : 03:38:36
Hi,

I have a table called Daily.
It has 5 columns, "Testers ","Activity ", "GivenHours ","UsedHours " and " Delta ".
This table will be regularly updated every 12 hours.
Now I need to Accumulate the data from GivenHours and UsedHours with respect to the testers and insert the accumulated data Into a new table called "Weekly".
The accumulation should last only for 7 days and then it should be reset again to accumulate new data for the new week.

Weekly table should have 5 columns "Testers ","Activity ", "TotalGivenHours ", "TotalUsedHours " and " Percentage ".
Percentage is ( TotalUsedHours / TotalGivenHours ) *100.


Can anyone tell me how to do this?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-03 : 04:08:07
Yes. Start by reading this blog post
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

pravin14u
Posting Yak Master

246 Posts

Posted - 2008-04-03 : 04:11:37
Create a SQL Server Agent Job which will have the following steps and set it to run every week:

1. Truncate table Weekly
2. Insert the Accumulated data from Daily table



Prakash.P
The secret to creativity is knowing how to hide your sources!
Go to Top of Page
   

- Advertisement -