Hi,
I have a varchar column with mixed date formats, some are dd-mm-yyyy and others are mmm dd yyyy hh:mmAP, these latter having been generated automatically by SQL when I changed the column datatype from datetime to varchar.
I would like to run an update script to pattern match the latter and change to the former.
I've been trying something along the lines of
update dwsubmit set authoreddate = (select day(authoreddat e))+'-'+(select month(authoredd ate))+'-'+(select year(authoredda te)) where id = 841
to try and get the format conversion correct, but this is obviously not correct. I have tried a few combinations, but have had no joy. Any ideas?
Thanks, Matt.
I have a varchar column with mixed date formats, some are dd-mm-yyyy and others are mmm dd yyyy hh:mmAP, these latter having been generated automatically by SQL when I changed the column datatype from datetime to varchar.
I would like to run an update script to pattern match the latter and change to the former.
I've been trying something along the lines of
update dwsubmit set authoreddate = (select day(authoreddat e))+'-'+(select month(authoredd ate))+'-'+(select year(authoredda te)) where id = 841
to try and get the format conversion correct, but this is obviously not correct. I have tried a few combinations, but have had no joy. Any ideas?
Thanks, Matt.
Comment