I have a column of dates in varchar and i need to convert to date
问题 The dates are currently displayed as: ddmmmyyyy (12DEC2013) I've been playing around with this formula: DECLARE @Date char(8) set @Date='12312009' SELECT CONVERT(datetime,RIGHT(@Date,4)+LEFT(@Date,2)+SUBSTRING(@Date,3,2)) but I didn't have any success, can someone help me out with this. Additionally all my dates are in a column called TERMDT and I'd like to put all the new date values in a new column formatted as such. 回答1: Just give convert() an appropriate 3rd argument (the format): SELECT