Insert datetime tag value into SQL database using NestedQueries results in null value

Hi there,
I am trying to insert a datetime tag value into a sql table (column data type: datetime) using NestedQueries. It will insert a row with NULL value…

query- INSERT INTO dateTime(dateTime) VALUES(:x)
where x is a parameter (data Type DateTime, query type Update Query)

I want to insert something like this image

but I ended up getting something like this image


image
image

Cheers

Try putting quotes around your variable name for your parameter in the runNamedQuery call like:

system.db.runNamedQuery("DateTime", {"x":date})
1 Like