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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Calculate Business Hour
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sanjay5219
Posting Yak Master

240 Posts

Posted - 06/24/2013 :  11:34:10  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 06/24/2013 :  11:42:16  Show Profile  Reply with Quote
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

India
52326 Posts

Posted - 06/24/2013 :  12:29:53  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000