Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: determining work hours between 2 dates

by poqui (Deacon)
on Jun 13, 2006 at 03:31 UTC ( [id://554942]=note: print w/replies, xml ) Need Help??


in reply to determining work hours between 2 dates

The way we count workdays between 2 dates in data warehousing is to use a dimension table.

The Date Dimension will contain a row for every day in the calendar for a period of years; as far into the past as you are likely to care about, and at least 2 years into the future.
Each day is keyed with the date in date format (or you could use epochal date). There will be a column with a flag for Holiday, a flag for Weekday, and a flag for Workday.

We also have an aggregated column of Week_work_days_to_date, Month_work_days_to_date, Quarter..., Year..., Fiscal_year...; mainly because those are the most requested time spans.
If the time span you are interested in is not one of the standards, then you merely sum the the Workday flag for every day between your start and end dates.
  • Comment on Re: determining work hours between 2 dates

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://554942]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found