日期:2014-05-16 浏览次数:20451 次
select convert(varchar(10),cast(cast(Trandate as varchar) as datetime),120)+' '+
left(right('000000'+rtrim(TranTime),6),2) + ':'+
substring(right('000000'+rtrim(TranTime),6),3,2)+':'+
right('000000'+rtrim(TranTime),2) as v
from
(
select 20130929 as TranDate,145706 as TranTime
union all
select 20130929,94412
)t
/*
v
2013-09-29 14:57:06
2013-09-29 09:44:12
*/