Go4Expert (http://www.go4expert.com/)
-   SQL Server (http://www.go4expert.com/forums/sql-server-forum/)
-   -   need help in rowid values (http://www.go4expert.com/forums/help-rowid-values-t17333/)

merox 5May2009 00:42

need help in rowid values
i'm using sql server 2005
i have 2 tables, first table X, second table Y
X has column:

DEM_ID int
DEM_DATE datetime
DEM_QTY numeric(18,0)
constraint PK_DEMAND primary key nonclustered (DEM_ID)

Y has column:

FRC_ID int
FRC_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.

All times are GMT +5.5. The time now is 14:19.