"The date is not valid"

Henrik698Henrik698 Member Posts: 10
Hi,
I am using a Business Central version 14.5.
I am running a report in the job queue. The report is a processing only report, i.e. no RDLC layout.
When running in the job queue, the report fails with an error: "The date is not valid".
Tragically, turning the debugger on does not reveal where the error happens. The arrow just points at the line in codeunit 449:

REPORT.EXECUTE(ReportID,JobQueueEntry.GetReportParameters);

It is strange that when running the report manually, it does not generate an error.

Does anybody out there perhaps have an idea regarding this? Thanks in advance for any hints.

Best Answer

  • Henrik698Henrik698 Member Posts: 10
    Answer ✓
    I have found the reason.
    The report iterated through a table with a field of the type "datetime" in SQL but the type "date" in BC. Due to some integration, the field in the SQL table had a date value BUT ALSO a time value. This latter (the time value) caused BC to refuse to iterate past the record with a time in the field. This gave the error message "The date is invalid" and the debugger refused to point it out.

Answers

  • SanderDkSanderDk Member Posts: 467
    I think you have invalid data in your report parameteres.
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • Henrik698Henrik698 Member Posts: 10
    Thank you for the suggestion. I don't think that is the explanation because there are no date filters or anything with dates in the report parameters. It is an xml file and I have tried to regenerate it from scratch, still the same result. I have also examined it and there are no errors in the xml, it seems.
  • Henrik698Henrik698 Member Posts: 10
    Answer ✓
    I have found the reason.
    The report iterated through a table with a field of the type "datetime" in SQL but the type "date" in BC. Due to some integration, the field in the SQL table had a date value BUT ALSO a time value. This latter (the time value) caused BC to refuse to iterate past the record with a time in the field. This gave the error message "The date is invalid" and the debugger refused to point it out.
  • PascualPascual Member Posts: 9
    Good morning, just as a suggestion of where the problem may have come from
    Is it possible that the standard feature U31/12/2022 is used in a table that was not prepared for this?
Sign In or Register to comment.