I need the logic/ansi sql to update a column, LP_Qty in my table using another col in the same table this is RF_Qty. RF_Qty gets updated everyday as the table refreshes everyday. But LP_Qty should be equal to RF_Qty only when it is FisPeriodEnd_Dt, else it should retain it's previous value till it is FisPeriodEnd_Dt.
My target table has the following Cols
Item_Id
FiscalPeriod_Id (MonthLevel)
RF_Qty,
LP_Qty
there is another table called Fiscal_Period that has
FiscalPeriod_Id (MonthLevel)
FiscalPeriodEnd_Dt (A date)
We also have current_date to use as this is not for history
how do I populate the target table?
thanks in advance
My target table has the following Cols
Item_Id
FiscalPeriod_Id (MonthLevel)
RF_Qty,
LP_Qty
there is another table called Fiscal_Period that has
FiscalPeriod_Id (MonthLevel)
FiscalPeriodEnd_Dt (A date)
We also have current_date to use as this is not for history
how do I populate the target table?
thanks in advance