Aged Debt

Can anyone suggest how I would go about maintaining fields in a Navision table for aged debt. I have a SQL Server Stored Procedure that can calculate aged debt values, the following calculates last months debt: SELECT @Aged1 = ISNULL(SUM(DCLE.[Amount (LCY)]), 0) FROM [My CRONUS UK Ltd_$Cust_ Ledger Entry] AS CLE INNER JOIN [My CRONUS UK Ltd_$Detailed Cust_ Ledg_ Entry] AS DCLE ON DCLE.[Cust_ Ledger Entry No_] = CLE.[Entry No_] WHERE CLE.[Posting Date] >= @PreviousMonth1From AND CLE.[Posting Date] < @PreviousMonth1To AND CLE.[Customer No_] = '10000'