web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Error when running Historical Aged Trial Balance - "Cannot insert the value NULL into column 'AgingPeriod', table 'tempdb.dbo.#TransactionTEMP"; DBMS 515

(0) ShareShare
ReportReport
Posted on by

Good Morning Everyone,

We keep getting the following error when attempting to run a Historical Aged Trial in Dynamics 2013 R2.

The first error window states:

[Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert the value NULL into column 'AgingPeriod', table 'tempdb.dbo.#TransactionTEMP________________________

Once you click OK, a second window opens stating:

The stored procedure rmHistoricalAgedTrialBalance returned the following results: DBMS: 515, Microsoft Dynamics DP: 0.


I found other other thread on the forum pertaining to the error message but the fix didn't work. I've checked the table RM20101 and all dates are withing normal time frame. I've also restarted SQL Services and the entire server to clear out the temp table but no luck.

Thanks!

Dynamics_5F00_AgingTrailBalance_5F00_Error1.jpg

Dynamics_5F00_AgingTrailBalance_5F00_Error2.jpg

*This post is locked for comments

I have the same question (0)
  • Derek Albaugh Profile Picture
    Microsoft Employee on at

    Hello,

    We've seen errors similar to this in the past caused when there is a transaction entered for a year that is out of range. Example - the year was entered as 1802. To find out if this is the case you can use SQL Server Management Studio to look at the RM20101 Due Date, Document Date, and Discount Date.

    a. To find the out of range date, you execute the following scripts in SQL. One set is for the Open Table

    PRINT 'RM20101 DocDate'

    PRINT '----'

    SELECT * from RM20101 where DOCDATE<'1900-01-01' or DOCDATE >'2065-12-31'

    PRINT 'RM20101 Due Date'

    PRINT '----'

    SELECT * from RM20101 where DUEDATE<'1900-01-01' or DUEDATE>'2065-12-31'

    PRINT 'RM20101 Discount Date'

    PRINT '----'

    SELECT * from RM20101 where DISCDATE<'1900-01-01' or DISCDATE>'2065-12-31'

    PRINT 'RM20101 GLPostingDate'

    PRINT '----'

    SELECT * from RM20101 where GLPOSTDT<'1900-01-01' or GLPOSTDT>'2065-12-31'

    b. The Script Results Below will show records in the History table.

    PRINT 'RM30101 DocDate'

    PRINT '----'

    SELECT * from RM30101 where DOCDATE<'1900-01-01' or DOCDATE >'2065-12-31'

    PRINT 'RM30101 Due Date'

    PRINT '----'

    SELECT * from RM30101 where DUEDATE<'1900-01-01' or DUEDATE>'2065-12-31'

    PRINT 'RM30101 Discount Date'

    PRINT '----'

    SELECT * from RM30101 where DISCDATE<'1900-01-01' or DISCDATE>'2065-12-31'

    PRINT 'RM30101 GLPostingDate'

    PRINT '----'

    SELECT * from RM30101 where GLPOSTDT<'1900-01-01' or GLPOSTDT>'2065-12-31'

    c. If any results from the above step, use a similar SQL statement below to update with the row with the correct date to reflect the correct year.  (**MAKE SURE TO HAVE A CURRENT AND RESTORABLE BACKUP**)

    Example:  UPDATE TTTTT SET DDDDD = 'XXXX' WHERE DEX_ROW_ID = YYYY

    **Replace TTTTT with the correct table name such as RM20101 or RM30101, replace DDDD with the column name such as DOCDATE, DUEDATE, GLPOSTDT or DISCDATE, replace XXXX with the correct transaction date and Replace YYYY with the Dex_Row_ID value.

    Another option we can do is grab a DEXSQL.log of the error message in Dynamics GP. This should provide information on which record is causing the issue. I have attached a kb article for the DEXSQL.log below.

    850996 How to create a Dexsql.log file to troubleshoot error messages in Microsoft Dynamics GP

    support.microsoft.com/.../en-US

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans