cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to insert Time Stamp for SQL Database

Former Member
0 Likes
2,227

Hi All,

I need to insert timestamp in milliseconds into the SQL database. The database is taking date but when i'm trying to insert along with the time, it is throwing the following error "Incorrect syntax near 12".

I have given the datatype as DateTime in XI.

Please let me know how i can solve this issue.

Regards,

Manisha Gogineni

View Entire Topic
Former Member
0 Likes

Hi All,

I have tried using the convert function. The statement we are trying to give to the SQL database is CONVERT('2008-15-01 08:19:36.688','YYYY-MM-DD HH24:MI:SS.FF',121). its still showing the following error Incorrect syntax near '2008-19-01 08:19:36.688'.

Regards

Manisha

Former Member
0 Likes

Hi Manisha,

Your statement is not correct.

CONVERT('2008-15-01 08:19:36.688','YYYY-MM-DD HH24:MI:SS.FF',121).

change to :-

CONVERT(datetime,'2008-15-01 08:19:36.688',121).

try now.

the style id 121 itself represents the format you want to send data.