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,228

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,

I have given CONVERT(datetime,'2008-15-01 08:19:36.688',121) and the datatype in XI as well as database is DATETIME, but it is giving an error saying "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."

Regards,

Manisha Gogineni

Former Member
0 Likes

Hi Manisha,

Try giving the below. I donot have an SQL server DB to test it at my end.

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

hope it helps.