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 |
FriendOfGhost
Starting Member
9 Posts |
Posted - 2010-10-09 : 18:24:47
|
Okay, here's a new question:Table1 have these columnsField1-Field2-Field3-Field4-Field5I'll call my sp with a parameter of, lets say 10 (integer)sp have to check last field (which is field5)and add columns from 5 to parameter which is 10Field6-Field7-Field8-Field9-Field10result columns should be:Field1-Field2-Field3-Field4-Field5-Field6-Field7-Field8-Field9-Field10any help please ? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
FriendOfGhost
Starting Member
9 Posts |
Posted - 2010-10-09 : 18:34:30
|
Column names are actually week numbers of year. they go like Week5226, Week5227... until today. I need weekly sales in my project. I can calsulate them with sps and views but its too slow. every report takes 5 to 10 minutes for only one year as there are 800 products and 200 different companies. do the math. my solution was building a table with weekl columns and update these values with triggers in sales table.question is, user can make a sales today and trigger will update the value for this week. 2 month later, when he make another sales there will be a 2week number gap'. my quesiton is about "filling this gap"by the way, if you have any better (fast) idea to get weekly sales I would be happy to hear it.thanks. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
FriendOfGhost
Starting Member
9 Posts |
Posted - 2010-10-10 : 06:22:59
|
I solved the problem. thanks. |
 |
|
|
|
|