Insert Dateset -- Loaded for all months
Set A.PreviousMonthvalue = B.CurrentMonthvalue
From Dataset A
LEFT Outer Join
ON A.ID = B.ID
AND A.place = B.Place
WHERE B.Date = Month(A.Date)-1
Product Current Month Previous Month previous month1 previousmonth2
xxxx Currentvalue Previousvalue etc etc
The problem in the above query is..it is updating only all applicable data in the previous month. logically last month may have more records which are not available in the current month.
I wanted to update all the records in the previous month (even if condition not matches). For example, the current month may not apply for all place but it is filtering for the previous month too.
Please help on this.