SELECT substring((case len(replace(更换时间,':','')) when 3 then '0'+replace(更换时间,'') else replace(更换时间,'') end)+'0000',1,6) FROM [yhcbpara].[dbo].[YH换表换CT记录表视图] --where replace(更换日期,'-','') + replace(更换时间,'') >= '20120502000000' and replace(更换日期,'') <= '20120510000000'