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 |
|
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 |
|
|
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 Weekly2. Insert the Accumulated data from Daily tablePrakash.PThe secret to creativity is knowing how to hide your sources! |
 |
|
|
|
|
|