1 2 Previous Next 18 Replies Latest reply on Feb 26, 2013 2:02 PM by user522961 Go to original post
• ###### 15. Re: between ( 9 PM) and (7 AM)
That doesn't cover the period 0 - 7 am. Let's leave to the OP to decide.
The way I see it is like some decades old story: there were three work shifts 6-14,14-22,22-6 (that was the official order) established for the whole country. In the local bakery there was a need to start machines at 2 am. So someone had to do it each Monday too, but at the time of paying him - the night shift additional seemed appropriate to all, but how about weekend/holiday additional - was he doing the Sunday's third shift or just working on Monday ?
The OP might be after something similar.

Regards

Etbin
• ###### 16. Re: between ( 9 PM) and (7 AM)
Etbin wrote:
That doesn't cover the period 0 - 7 am. Let's leave to the OP to decide.

You wrote:
``and begindttm between trunc(begindttm) + 21 / 24 and trunc(begindttm) +31 / 24``
trunc(begindttm) +31 / 24 will lead to nex day.. That will also not cover 0-7AM, since your LHS is begindttm
• ###### 17. Re: between ( 9 PM) and (7 AM)
Yeah, the OP is more likely looking for something like
``````select prcstype
,prcsname
,prcsinstance
,runcntlid
,dbname
,oprid
,runstatus
,begindttm
,enddttm
--,to_number(to_char(enddttm,'DDMMYYHH24MMSS') )- to_number(to_char(begindttm,'DDMMYYHH24MMSS')) duration
,(enddttm-begindttm)*(24*60*60) as duration_seconds
from   psprcsrqst
where  oprid='user1'
and    begindttm >= trunc(begindtdm)+(21/24)
and    enddttm <= trunc(begindttm)+(31/24);``````
• ###### 18. Re: between ( 9 PM) and (7 AM)
Thanks to all.
1 2 Previous Next