A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
What results do you expect?
Check next query:
;
with CTE as
(
select *, lag(QTY_ON_HAND) over (order by [Date]) p
from MyTable
)
select [Date], Store_ID, Item_ID, QTY_ON_HAND
from CTE
where QTY_ON_HAND > p
order by [Date]