Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Calculating the Number of Business Hours Passed Since a Point of Tme


Calculating the Number of Business Hours Passed Since a Point of Tme

Author
Message
c1680222
c1680222
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
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
sunnyplace
sunnyplace
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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.
Learning user
Learning user
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
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
Ian.Donaldson
Ian.Donaldson
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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 Smile
ryk 98103
ryk 98103
SSC Rookie
SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)

Group: General Forum Members
Points: 36 Visits: 147
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!
Mohammad Mazharuddin Ehsan
Mohammad Mazharuddin Ehsan
Old Hand
Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)

Group: General Forum Members
Points: 383 Visits: 2439
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

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search