Reputation: 1472
I have the following code and I want get all minutes from time type.
declare @time time
set @time = '01:30'
declare @minutes int
--select @minutes = convert time to minutes here
select @minutes -- @minutes == 90
Please help.
Upvotes: 10
Views: 10074
Reputation: 175768
The difference between @time
& midnight;
set @minutes = datediff(minute, '00:00:00', @time)
Upvotes: 24