>Thanks.
>
>Ok, now try this. The running total column isn't quite right:
>
>
>
>USE Northwind
>
>SELECT OrderId,
> UnitPrice,
> Quantity,
> UnitPrice * Quantity AS RowAmt,
> (SELECT SUM(UnitPrice * Quantity)
> FROM [Order Details]
> WHERE OrderId = o.OrderId) AS 'Running Total'
> FROM [Order Details] o
>
I don't have Nortwind here. But this is not the running total, this is just a sum of all order details for each Order record. What exactly did you want to produce? Running total usually involves dates.
If it's not broken, fix it until it is.
My Blog