Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting number of working hours
Message
 
À
16/04/2015 15:26:36
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01618554
Message ID:
01618615
Vues:
53
>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?

Could you post some example data and desired result from it?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform