I am importing a text column into a SQL Server 2008 database.
I have a field 'carcassdate' in the following format
'11/05/2017 9:18:46 a.m.'
'10/05/2017 1:08:27 p.m.'
etc. How can I convert this into a proper SQL Server 2008 datetime (24 hour) column please?
I can't seem to find a proper solution for this.
My desired result is
'11/05/2017 9:18:46 a.m.' converted to 2017-05-11 09:18:46.000
'10/05/2017 1:08:27 p.m.' converted to 2017-05-10 13:08:27.000
Thanks in advance.
What I have tried so far: strip the date part of the column
select convert(date, convert(varchar(10),carcass_date)) as carcassdate
That's the easy part..But I'm struggling with the time part.
Thanks for your help in advance.