Arthematic overflow only on one server- mssql sql
When running a sql insert query with CONVERT('datetime', '2023-12-12 11:27:00',120) in an insert statement into a table this works on one server and not the other.
i.e. to record datetimereceived
Property datetimereceived As%TimeStamp(EXTERNALSQLNAME = "date_time_received", EXTERNALSQLTYPE = 93) [ SqlColumnNumber = 12, SqlFieldName = date_time_received ];The gateway connections are the same, The one that works runs a v6 SQL server db the one that doesn't is the standard version 10 so although there is a mismatch i do not believe it would be this as the older setup works
Has anyone come across this
[SQLCODE: <-400>:<Fatal error occurred>]
[%msg: < SQLState: (22003) NativeError: [8115] Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error converting expression to data type datetime. >]
Comments
Hi,
could you consider using a different date format such as YYYY-MM-DDTHH:MI:SS which is more robust and less dependent on specific settings, CONVERT(datetime, '2023-12-12T11:27:00', 126)
HTH
Rewrote the statement so going to mark Eyal's answer as accepted as it was the correct approach to try a different conversion function.