I want to get only Time from a DateTime column using SQL query using SQL Server 2012:
The datetime format in the column at the moment is:
dd/mm/yyyy hh:mm
example - 16/10/2018 11:50
I want to extract the hh:mm and convert the column to a time format (hh:mm or hh:mm:ss)
Any assistance would be much appreciated.
Thanks.
If the column is a string, do you simply want this?
select convert(time, right(col, 5))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With