I need to calculate a percentage based on two rows next to each other. The Select statement finds them and calculates correctly but the Update error says:
Incorrect syntax near the keyword 'Group'
Code:
Update L
Set [TCKR%] = (L.Stock_Close - E.Stock_Close) / L.Stock_Close
From HistData as L
Inner Join HistData as E on L.RecordID = E.RecordID + 1
Where L.RecordID = L.RecordID
Group by L.RecordID, L.Stock_Close, E.Stock_Close
Order by
does not work either