9

我有以下代码,我想从时间类型中获取所有分钟。

declare @time time
set @time = '01:30'

declare @minutes int

--select @minutes = convert time to minutes here

select @minutes -- @minutes == 90

请帮忙。

4

1 回答 1

21

@time和午夜的区别;

set @minutes = datediff(minute, '00:00:00', @time)
于 2012-10-02T11:29:09.003 回答