Issue with Insert Time in SQL

Hi All,

I know this will be a dumb question but I can’t figure it out.
I’m reading time from a TAG and insert it into a DB table, but I always get the error Cannot coerce value 'Mon Jan 28 12:22:22 CET 2019' into type: class [Ljava.lang.Object;
The TAG is already in Date format and if I print its type, the console tells me that is “Java.Util:Date”.
Here it is the script and the output:

Inside the DB Table the column is formatted as “Datetime2”.

Any help on this?

Cheers,

Could you please show the complete script? Including how it’s used on the query. And please tell us what DB you’re using too.

At the moment, the screenshot only shows the first part (which is correct), but the second part in comments certainly isn’t correct (the statement isn’t passed to the query, the values aren’t in a list, …)

But at the moment, it’s unclear whether the error comes from problems in the driver, or wrong usage of the functions.

A DateTime2 field also requires the milliseconds to be part of the value.

Ok, I’m really stupid.
I forgot to include the statement inside the system.db.runPrepUpdate()
My bad! You know when you are so focused on one thing and you can not see the dumb things :sweat_smile:
Thanks for the hint :wink: