数据库里日期字段存储的格式是char(16),2015010102:23:56,怎么才能转换成标准的日期时间型呢?比如用系统时间就可以转:
select convert(varchar , getdate(), 120 )
--'2015-07-20 14:57:06'
------解决思路----------------------
select SUBSTRING('2015010102:23:56',1,4)+'-'+SUBSTRING('2015010102:23:56',5,2)+'-'+SUBSTRING('2015010102:23:56',5,2)+' '+SUBSTRING('2015010102:23:56',9,10)