Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Cant figure out how to convert
2020-07-14T03:10:01
into datetime.. help!

What I have tried:

convert(datetime, dda2.transaction.timestamp,103) + CAST(dda2.transaction.timestamp as DATETIME)


This isn't working
Posted
Updated 13-Aug-20 11:48am

1 solution

Try:
SQL
SELECT CONVERT(DATETIME, '2020-07-14T03:10:01', 126)
 
Share this answer
 
Comments
Sandeep Mewara 13-Aug-20 19:07pm    
Adding more details to what OG shared above.

For a date or time data type expression, style can have one of many values. Reference:
CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Docs[^]
SQL Server CONVERT() Function[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900