SQL Server Forums
Profile | Register | 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
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sanjay5219
Posting Yak Master

231 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

3724 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
52325 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  
 New 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.06 seconds. Powered By: Snitz Forums 2000