Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 varchar 包含格式为 ddmmyyyy hh:mm:mm:ss 的日期
我想用格式 dd/mm/yyyy hh:mm:ss 将其转换为日期时间
请知道怎么做
declare @datestr varchar(20) set @datestr = '31122012 10:00:00' select convert(datetime, substring(@datestr, 1, 2) + '/' + substring(@datestr, 3, 2) + '/' + substring(@datestr, 5, 10), 103)