日期:2014-05-17 浏览次数:20590 次
declare @x1 varchar(12),@x2 varchar(12)
select @x1='201310101232',@x2='201310101331'
select datediff(mi,
cast(left(@x1,4)+'-'+substring(@x1,5,2)+'-'+substring(@x1,7,2)+' '+substring(@x1,9,2)+':'+substring(@x1,11,2)+':00' as datetime),
cast(left(@x2,4)+'-'+substring(@x2,5,2)+'-'+substring(@x2,7,2)+' '+substring(@x2,9,2)+':'+substring(@x2,11,2)+':00' as datetime)) '分钟数'
/*
分钟数
-----------
59
(1 row(s) affected)
*/