?
Solved

Round caluclated difference to nearest quarter hour

Posted on 2007-10-09
4
Medium Priority
?
1,970 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:UniqueData
  • 3
4 Comments
 
LVL 18

Accepted Solution

by:
Yveau earned 2000 total points
ID: 20045081
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
 
LVL 18

Expert Comment

by:Yveau
ID: 20045083
Sorry, forgot the result:

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

...
0
 
LVL 7

Author Comment

by:UniqueData
ID: 20045194
awesome.

Thanks
0
 
LVL 18

Expert Comment

by:Yveau
ID: 20046405
Glad I could be of any help and thanks for the grade !
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question