Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

T-SQL question about converting nvarchar into datetime

syed haiderDec 13 2019 — edited Dec 14 2019

In sql server, the value = 20171030131152 exists in the database as start-time and 20171030131236 as end-time. I want to convert it into date time so that I can calculate elapsed time between start-time and end-time. Below is the code I tried to convert it start-time into datetime declare @starttime nvarchar(255) = '20171030131152' select CAST(@starttime as datetime)

Comments
Post Details
Added on Dec 13 2019
6 comments
796 views