Ticket #29172
Question
I am running a report and getting this error: [SQL0802] Data conversion or data mapping error. I don't know what the issue is or how to solve this.
Answer
Informed customer almost every instance we've seen of this error is due to a data related issue, so if you are getting this error this would be a great place to start looking. In customer's application he was using the CAST AS INT function in a calculation to convert a date value (stored as a character field) to an integer, to then ultimately use for an MRC_GETDATE conversion. Upon investigating the data, explained to customer that there are records in the data set with null/blank values for the date, which are causing the error when the database attempts to convert these values to an integer with the CAST AS INT function. To resolve, customer added a condition to his calculation to only perform the conversion calc if the alpha date field was not blank.
Asked on June 26, 2019