Hello I am using SQL Server and I have this column :
data 6/19/2019 3:10:12 PM 12/23/2016 5:02:15 AM I wanted to extract only the time so I used the following query :
select try_parse([data] as time using 'en-US') from Table_1 But the problem is I get as a result this :
15:10:12.0000000 05:02:15.0000000 All is okay except the 0 I mean I would like to get :
15:10:12 05:02:15 Thank you very much for your help !
timehas a scale. Trytime(0). On a different note, why are you storing dates as avarcharand not adatetimeordatetime2? Also,TRY_PARSEandtimewere introduced in SQL Server 2012, however, you've tagged SQL Server 2008 and 2005?