I was going to be rude and suggest that since everything was exactly the same as with the other table, the problem must just be bad juju and should try a burnt offering, but Iāll resist that temptation.
Letās just go through how this worksā¦
Clarion issues a PUT.
The Clarion MSSQL or ODBC driver turns that into a SQL statement, something like:
Update dbo.rsn set changdeon = :changedon
where resourceID = 314.
:changedon points to a memory location in your clarion program, where the binary value that corresponds to ā2025-04-16 07:28:13.91" sits in a STRING(8). So far as remember it is basically three separate numbers for the date portion and the number of seconds since midnight for the time portion.
The MSSQL ODBC driver on your system gets this information and sends it to the database. Possibly it turns the value that Clarion has passed it into a string literal and hard-codes it into the rest of the query; it seems unlikely, but I think it makes sense given the error your are getting. The string literal could just be a function of the MSSQL profiler trying to make things easier for you to read.
I assume you have taken that query and tried submitting it directly to MSSQL? Does it work if you put the āTā in he middle, like Flavio suggests? According to wikipedia the extra decimals could cause trouble: " There is no limit on the number of decimal places for the decimal fraction. However, the number of decimal places needs to be agreed to by the communicating parties. For example, in Microsoft SQL Server, the precision of a decimal fraction is 3 for a DATETIME, i.e., āyyyy-mm-ddThh:mm:ss[.mmm]ā.[29]"
but that is specific to datetime, and would not be true for datetime2.
So, what could be wrong? Firstly Iām confused by the fact that the query arriving at the server does not have a āproperā where clause. Clarion would write a query of the form:
update yourtable set dt = :dt where . Unless you have specified NOWHERE for every column except RESOURCEID it doesnāt look like the sort of query Clarion would produce. Secondly, your check āI have imported the table from SQL in DCT (to check), and it imported the same as I have now for my current table.ā doesnāt help at all. I would think that if you try to import either a datetime or a datetime2 into Clarion it would create exactly the same structure: how could it do any different, there is no special TIME datatype in Clarion that allows for extra precision. Plus, as already mentioned, if the datetime value passed by Clarion is being turned into a string literal, it is not Clarion that is doing it.
Up to you to do more digging, or maybe you should just go a look for a fatted calf?