How to convert yyyy-mm-dd hh:mm:ss (in 24 hours format) to dd-mm-yyyy hh:mm:ss (in 24 hours format? I am using Sql Server 2008.
Given Date Format: 2017-12-18 18:16:49 - Its in DateTime format
Required Date Format: 18-12-2017 18:16:49
This Would work in Older SQL Server Versions Also, Converted to datetime first if it's VARCHAR otherwise you can skip that conversion.
SELECT convert(varchar,convert(datetime,'2017-12-18 18:16:49'),105) + ' ' +
convert(varchar(8),convert(datetime,'2017-12-18 18:16:49'),14);
Use this Link as Reference for Date & Time conversion Formats