SELECT * INTO ##TempFROM(SELECT [Date] , Amount , Amount+COALESCE((SELECT SUM(Amount) FROM Amount b WHERE b.[Date] < a.[Date]),0) AS RunningTotal FROM Amount a ORDER BY [Date])XSELECT TOP 1 * FROM ##TempORDER BY Amount Desc