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 |
|
merox
Starting Member
2 Posts |
Posted - 2009-05-04 : 14:57:02
|
| i'm using sql server 2005 for my asp.net program.i have 2 tables, first table X, second table YX has column:DEM_ID intDEM_DATE datetimeDEM_QTY numeric(18,0)constraint PK_DEMAND primary key nonclustered (DEM_ID)Y has column:FRC_ID intFRC_YEAR numeric(4)FRC_MON numeric(2)FRC_SALES numeric(18,0)FRC_FRCSALES numeric(18,0)FRC_FRCLOG numeric(18,0)constraint PK_FORECASTSALES primary key nonclustered (FRC_ID)What i want to do is put each month and year from col dem_date in table X to col frc_year and frc_mon in table Y and put sum dem_qty per mon and year to frc_sales. and then get frc_frcsales row values from calculation (e.g for row 90 = (4*89th row in col frc_sales)+(6*84th row in col frc_sales+....), for row 91 =(4*90th row in col frc_sales)+(6*85th row in col frc_sales+....) ) and continues everytime i had new row on table X.Best Regards & Thanks. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|