Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Calculate Business Hour

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2013-06-24 : 11:34:10
Hi All,

I have to calculate the datediffrence in hrs and based on some timing.

Like Timing should be calculated between 9 Am - 04:30 PM EST from Monday to Friday

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-06-24 : 11:42:16
quote:
Originally posted by sanjay5219

Hi All,

I have to calculate the datediffrence in hrs and based on some timing.

Like Timing should be calculated between 9 Am - 04:30 PM EST from Monday to Friday

Use a Calendar table and calculate the sum of hours between start date and time and end date and time. The calendar table will allow you to exclude Saturdays and Sundays.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-24 : 12:29:53
See

http://visakhm.blogspot.in/2010/03/calculating-business-hours.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -