Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL count by time intervals

Re: SQL count by time intervals

From: Schroeder <schroeder915_at_yahoo.com>
Date: 10 Nov 2005 16:17:45 -0800
Message-ID: <1131668265.723358.61510@g43g2000cwa.googlegroups.com>


Okay Michel. I'm not real swift, but I think I get it. And I just have to say, WOW!

I was getting hung up thinking about how subtracting 7 hours would turn the clock back, and then I didn't understand how that would return a correct shift, i.e., I was thinking that a call at 1:00 AM (3rd shift) after subtracting 7 hours, the result would be 2nd shift instead.

Now I see that isn't at all what's happening.

You're taking the day as an entity with 24 hours, where midnight is 0. So, if the first shift starts at 7, you have to set it at the start of the day (i.e., the start of day by my work clock has been shifted forward 7 hours from midnight, 0, so you're just resetting my start of day to zero).

If, for example, the first shift started at 5 AM, I'd want to reset it to a zero value corresponding to the actual start of day at midnight by subtracting 5.

Then, the division by 8 splits up the solution set into 3 equal parts of 24 hours.

Crystal clear (I think). See - this is what I love about forums like this where people approach a problem in a completely unique way than I do.

Thanks! Received on Thu Nov 10 2005 - 18:17:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US