Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««12345

Calculating the Number of Business Hours Passed Since a Point of Tme Expand / Collapse
Author
Message
Posted Monday, January 3, 2011 12:32 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, January 6, 2011 4:55 AM
Points: 1, Visits: 12
Hello, it's a great tool for calculate SLA's

but I'm trying to use this for calculate saturday morning include (here (Brazil) we work in saturdays too)


can you help me to do this modification?

thank you
Post #1042025
Posted Friday, March 18, 2011 12:29 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, April 4, 2011 12:21 PM
Points: 2, Visits: 16
Very nice job with the function that calculates time between two dates, I am working in a report that I need to calculate the number of working days less holidays and I was wondering if those functions can be modified to be used to calculate working days excluding holidays, I do not need to remove lunch hour. I am new in this, so I will appreciate a little guidance.
Post #1080628
Posted Tuesday, March 27, 2012 1:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 15, 2012 4:51 AM
Points: 3, Visits: 12
hi

i am new to this forum

my problem is i have table to define the working hours of the employees based on that i need to calculate the hours

there is no such rule of common shift timeing

>>Problem statements

Have Creation date of ticket

Employee work in diffrent shift based on the World country they support

so weekoff and shift time are in one table

and list of holidays in another table

so now i need to calculate the time spent as of now... received time and current time - i should get the business hours

Table 1 : Shift start Time | Shift End time | Weekoff1 | weekoff2 |

Table 2 : Holidays

Result should be business hours
Post #1273239
Posted Tuesday, May 14, 2013 5:29 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 12, 2014 4:03 AM
Points: 2, Visits: 30
I am confused I am just getting

I just keep getting error messages because of the dbo.DateAt...... I have checked through it and understand that this is saying the start and end times but confused on how this needs to be written so the function will work. HELP :)
Post #1452513
Posted Tuesday, January 26, 2016 2:36 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 30, 2016 9:54 AM
Points: 26, Visits: 140
Jeff,

I found your 'business hours' solution within this old post and just wanted to thank you for it. My initial testing shows that it should work just fine for my particular needs with a few tweaks to remove the lunch hour and add some alternate time windows & holidays.

You might not have thought that your reply would still be helping folks 6+ years later, but I'm sure glad you saved me a boatload of upfront work on this! Your solution seems much better and elegant than the other solution offered in the thread, since it's set-based.

Again, thanks so much!
Post #1755867
Posted Wednesday, January 27, 2016 12:07 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, May 6, 2016 11:45 AM
Points: 379, Visits: 2,425
Hi folks,
It is heartening to see highly valuable posts still raining on my script published in 2007.
That year I had done my MCITP in SQL Server 2005, dev and admin and was very enthusiastic
about it as I was working on SQL Server and TSQL development in those days and was looking to build further my career on this wonderful technology.

Time and tides moved me back to development Oracle since August, 2013

Because of this reason, I could not reply to very positive feedbacks posted by
'Ian.Donaldson'
'Learning user'
'sunnyplace'
'c1680222'
'geoff.walton'

who used my script succesfully.

I am sorry to you guys. Life sucks sometimes.

It has been amazing to work both the TSQL and the PL/SQL.
I am looking forward to develop this solution in PL/SQL also, when I get time.

Thanks,
Maz


-----------------------------------------------------------
Time Is Money
Calculating the Number of Business Hours Passed since a Point of Time
Calculating the Number of Business Hours Passed Between Two Points of Time
Post #1755934
« Prev Topic | Next Topic »

Add to briefcase «««12345

Permissions Expand / Collapse