Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting number of working hours
Message
De
16/04/2015 15:26:36
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Getting number of working hours
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01618554
Message ID:
01618554
Vues:
58
I have a table which contains 291000 records. This represents the non working hours. That includes holidays, weekends and overnight hours. Those timeframes should not be considered for a specific calculation I need to perform.

The non working hours table contains a start time and an end time.

So, basically, if I have two transactional dates in a table such as 01/10/2014 08:00:00 and 15/10/2014 17:53:24, I need to use this time table to calculate how many working hours applied between these two dates.

This is done by querying the time table and summarizing differentials.

So far, I have converted a logic from an old code. But, that is very deprecated. There has to be something better, such as a single SQL select that would be capable of returning the duration in hours and/or days.

Anyone has ever done something like that or would be able to provide a SQL select example of how you would see it?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform