I have tried this but get a syntax error near 'ROWS' -for the life of me I cannot figure it out. Basically what I need is a running total of the rtv_qty by model_id and cust_id in date order.
Any help is appreciated
SELECT model_id, cust_id, date_id, rtv_qty, sum(rtv_qty) OVER (PARTITION BY model_id + cust_id ORDER BY date_id ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cum_rtv_qty FROM dbo.cust_return_to_vendor