We are getting the following error when running the Stock Status Report. The report has no customizations. I did open a ticket with Epicor, but checking here as well. The report was working up until Monday of this week. It was just brought to my attention that it wasn’t working. Seems odd that all of a sudden that it would stop working.
Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
Stack Trace:
at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource`1 completion, Int32 startRpc, Int32 startParam)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Ice.Core.RptBase.ReportRowDataWriter.WriteRow(IRow row) in C:\_Releases\ICE\ICE3.2.200.10\Source\Server\Internal\Lib\TaskLib\RptBase\ReportRowDataWriter.cs:line 73
at Erp.Internal.IM.IMR40.PrintReport() in C:\_Releases\ERP\UD10.2.200.10\Source\Server\Internal\IM\IMR40\IMR40.cs:line 2602
at Erp.Internal.IM.IMR40.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:\_Releases\ERP\UD10.2.200.10\Source\Server\Internal\IM\IMR40\IMR40.cs:line 1097
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_Releases\ICE\RL3.2.200.0\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 98
at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\RL3.2.200.0\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 57
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\ICE3.2.200.10\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\ICE3.2.200.10\Source\Server\Services\Lib\RunTask\RunTask.cs:line 549
Along with @ckrusen’s suggestion to check SysDate, also check to make sure there aren’t any NULL TranDates or SysDates. Looks like the database table allows nulls, but I can’t think of any reasons there should be a valid null value in these columns.
How many parts are in that class? Possible to select subsets of them to find the errant partum?
Another thing to check is if the WIP Recon report runs okay. I only suggest that as you can pre-filter the data by starting and ending dates, as well as choosing either TranDate or SysDate.
One last thing back on the SSR report… does it still fail if you choose today’s date, or does it require going back to a certain date.
A BAQ will make nulls to space so you won’t see it like you would in SSMS. You would have to make a calculated field that you suspect is the culprit with something like IsNull(field,‘Null Value’) to find them.
I was suspicious when I did the Min Max on the dates but did not see Null or Spaces - everything was a date
The ISNULL code compiled but blew up when executing.
I tied something similar with a case statement
case
when PartTran.TranDate IS NULL then ‘NULL’
else 'OK DATE'
end
They were all good. I did the same for SysDate - same result. Very puzzled. It could be a case of the error not meaning what we think it means. It could be another table. It could be an epicor calculation (The RDD references virtual tables).
I’ve seen this topic a few times on various forums but not if or how people were able to fix the issue.
One more thing - the System Monitor has a “Activity” column in the task detail tab. It will tell you what part was being processed when the report fails. However this did not help so far. I queried part tran for those records and the dates looked normal. In fact most had the Sys date and Tran date being the same
It looks like having a bad date in Part Lot on the Mfg Date or Cure Date will cause the Stock Status to have this error. This can happen by DMT - it will allow bad dates.
Luckily enough it is easy enough to fix manually or with a DMT.