How can I change a normal date to closing date

I have a few thousand entries that should have been posted as closing entries but are showing normal dates.

The client is using 3.01 on SQL.

The Source Code is CLSINCOME so I am assuming the user changed the dates in the journal to normal before posting.

I want to modify the dates in the posted entries to Closing type.

I can run a non-printing report but not sure of the code, any help appreciated.

Just using CLOSINGDATE function:

TheDate := CLOSINGDATE(TheDate);

GLEntry.SETRANGE(“Document No.”,DocNo);
IF “Posting Date” <> CLOSINGDATE(“Posting Date”) THEN BEGIN
“Posting Date” := CLOSINGDATE(“Posting Date”);

Tried the above but get an error “The date is not valid”

Just be real careful to get this right. I assume this is the GL. and NAV uses the Posting Date field as part of the CONSISTENT algorithm, and its bases on a check sum. So you could have and issue where it works now, but then some time in the future you get a date that coincidentally passes the check sum. Though I know that since they “toughened” the routine, its not likely now.

Make sure to add a consistent command to the routine that does the conversion.

I wouldalso recommend adding a flag field to indicate the records you change, so that if something does go wrong later its easy to fix.

Decided to take another tack, export the entries, change date, delete existing entries and import corrected entries.

Tested in backup and is a perfect result.

This way I can check the data externally and make all my changes including description.

Also I have a backup of the changed records.