Re: Work hours?

2019-08-30 Thread Steven Lembark
> > Any thoughts as to the best way to approach this? > > Use generate_series: > > https://www.postgresql.org/docs/11/functions-srf.html > > to generate all the days in the month. > > Loop over the days and use EXTRACT: > > https://www.postgresql.org/docs/11/functions-datetime.html#FUNCTIO

Re: Work hours?

2019-08-28 Thread Gavin Flower
that, given a month, and a year as input returns the "work hours" in that month. In other words something like 8 * the count of all days in the range Monday to Friday) within that calendar month. Any thoughts as to the best way to approach this? In data warehouse app

Re: Work hours?

2019-08-28 Thread Christopher Browne
On Wed, 28 Aug 2019 at 01:02, Ron wrote: > We did something similar to that, except all the columns were in one > single table. It wasn't a data warehouse, though: the RDBMS we used could > be coerced into using a date index when large ranges were needed in detail > tables by joining it to T_CAL

Re: Work hours?

2019-08-28 Thread Uwe Seher
e a function that, given a month, and a year as input returns > the "work hours" in that month. In other words something like > > 8 * the count of all days in the range Monday to Friday) within that > calendar month. > > Any thoughts as to the best way to approach this? &g

Re: Work hours?

2019-08-28 Thread Luca Ferrari
On Wed, Aug 28, 2019 at 12:27 AM stan wrote: > Any thoughts as to the best way to approach this? I've written a couple of functions to compute working hours depending on a possible per-day hour template. Another possible implementation besides the other proposed solutions.

Re: Work hours?

2019-08-28 Thread Steve Atkins
> On Aug 27, 2019, at 11:27 PM, stan wrote: > > I am just starting to explore the power of PostgreSQL's time and date > functionality. I must say they seem very powerful. > > I need to write a function that, given a month, and a year as input returns > the &quo

Re: Work hours?

2019-08-27 Thread Ron
that, given a month, and a year as input returns the "work hours" in that month. In other words something like 8 * the count of all days in the range Monday to Friday) within that calendar month. Any thoughts as to the best way to approach this? In data warehouse app

Re: Work hours?

2019-08-27 Thread Christopher Browne
On Tue, Aug 27, 2019, 6:27 PM stan wrote: > I am just starting to explore the power of PostgreSQL's time and date > functionality. I must say they seem very powerful. > > I need to write a function that, given a month, and a year as input returns > the "work hours"

Re: Work hours?

2019-08-27 Thread raf
eed to write a function that, given a month, and a year as input > > > returns > > > the "work hours" in that month. In other words something like > > > > > > 8 * the count of all days in the range Monday to Friday) within that > > > ca

Re: Work hours?

2019-08-27 Thread Paul A Jungwirth
On Tue, Aug 27, 2019 at 3:27 PM stan wrote: > I need to write a function that, given a month, and a year as input returns > the "work hours" in that month. In other words something like > > 8 * the count of all days in the range Monday to Friday) within that > calendar m

Re: Work hours?

2019-08-27 Thread Rob Sargent
On 8/27/19 4:59 PM, Adrian Klaver wrote: On 8/27/19 3:27 PM, stan wrote: I am just starting to explore the power of PostgreSQL's time and date functionality. I must say they seem very powerful. I need to write a function that, given a month, and a year as input returns the "work

Re: Work hours?

2019-08-27 Thread Ron
On 8/27/19 5:27 PM, stan wrote: I am just starting to explore the power of PostgreSQL's time and date functionality. I must say they seem very powerful. I need to write a function that, given a month, and a year as input returns the "work hours" in that month. In other words so

Re: Work hours?

2019-08-27 Thread Adrian Klaver
On 8/27/19 3:27 PM, stan wrote: I am just starting to explore the power of PostgreSQL's time and date functionality. I must say they seem very powerful. I need to write a function that, given a month, and a year as input returns the "work hours" in that month. In other words so

Work hours?

2019-08-27 Thread stan
I am just starting to explore the power of PostgreSQL's time and date functionality. I must say they seem very powerful. I need to write a function that, given a month, and a year as input returns the "work hours" in that month. In other words something like 8 * the count of