1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need help in rowid values

Discussion in 'SQL Server' started by merox, May 4, 2009.

  1. merox

    merox New Member

    Joined:
    May 4, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    i'm using sql server 2005
    i have 2 tables, first table X, second table Y
    X has column:
    Code:
    DEM_ID int
    DEM_DATE datetime
    DEM_QTY numeric(18,0)
    constraint PK_DEMAND primary key nonclustered (DEM_ID)
    Y has column:
    Code:
    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.
     

Share This Page