Round caluclated difference to nearest quarter hour

I have found functions here that round a time (such as 3:12pm) to the nearest quarter hour, however, I can't find anything to round a calculated difference to the nearest quarter hour.

I have total time in minutes that someone has worked on a project.  I need turn it into hours (rounding to the nearest qtr hour)

For example:  130 minutes = 2.25 hr
LVL 7
UniqueDataAsked:
Who is Participating?
 
YveauCommented:
Try this:

declare @y int
select @y = 130

select cast(round(@y/15.00,0)/4 as decimal(10,2))

... think in 15 minute sections, hat's the trick !

Hope this helps ...
0
 
YveauCommented:
Sorry, forgot the result:

---------------------------------------
2.25

...
0
 
UniqueDataAuthor Commented:
awesome.

Thanks
0
 
YveauCommented:
Glad I could be of any help and thanks for the grade !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.