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.
Author |
Topic |
peitech
Starting Member
10 Posts |
Posted - 2012-03-06 : 08:30:09
|
Guys,I'm trying to calculate the time difference between two datetime strings, however, if any non work days (definied as Saturday and Sunday where we are) are within the range they should be ignored.The best I've come up with is using the difference in week number between the two datetime fields and multiplying this by 48. I then subtract the result of this from the standard datediff function returning hours. I've been told a calendar table is the way to go to get this to take account of holidays etc, however, I don't understand how I could use this to return time differences, I can see how you'd use it to say how many 'work days' between date x and y, but not how many hours where the days are workdays.Can anyone give me any tips here? |
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|