27 March, 2014
0 Comments
1 category
If you want to know the amount of elapsed minutes in the current quarter, you can use the following T-SQL code:
declare @CurrentDateTime datetime = '2014-03-27 10:56:10' declare @MinutesPassedInHour int = convert(int, datepart(minute, @CurrentDateTime)) declare @quarterCount int = @MinutesPassedInHour / 15 declare @MinutesPassedInQuarter int = (@MinutesPassedInHour - (@quarterCount * 15)) select @MinutesPassedInQuarter -- Result: 11
Tags: T-SQL
Category: Uncategorized