Re: Time Between Times

From: Jack Colletta <b_at_j.com>
Date: Sun, 25 Aug 2002 00:41:09 GMT
Message-ID: <FIV99.186689$SS.7617740_at_bin3.nnrp.aus1.giganews.com>


Maybe I mis-wrote my question. I need to query the three column table at a random time and return if the current time is Shift 1, Shift 2 or Shift 3.

Thanks

"Jim Kennedy" <kennedy-family_at_attbi.com> wrote in message news:a0D99.59784$aA.11694_at_sccrnsc02...
> subtract them and you get days.portion of a day. so if you subtract one
> from the other and get 3.25 then that is 3 days and a quarter of a day (6
> hours). Also works if the time is within a day.
> Jim
> "b" <b_at_j.com> wrote in message
> news:Drx99.159502$SS.6720102_at_bin3.nnrp.aus1.giganews.com...
> > Hello
> >
> > I have table with three columns shiftName (varchar), shiftStart (date),
> > shiftEnd (date)
> >
> > The data is
> >
> > Shift 1, '1-Jan-1899 7:00:00 AM', '1-Jan-1899 3:00:00 PM'
> > Shift 2, '1-Jan-1899 3:00:00 PM', '1-Jan-1899 11:00:00 PM'
> > Shift 3, '1-Jan-1899 11:00:00 PM', '2-Jan-1899 7:00:00 AM'
> >
> > I picked 1-Jan-1899 because the date is of no use to me. I actually
 just
> > need the Time.
> >
> > My task is to compare the current time [to_char(sysdate,'HH24:MI:SS')]
 and
> > get back what shift I am in. I am fine with Shift 1, and Shift 2. That
 is
> > simple. My problem comes with the query for Shift 3 the rolling over
> > midnight has me stumped.
> >
> > I guess my question is how can I compare the current time to preset
 times
> > and get back my shiftName column? Is there a between function?
> >
> > Thank you in Advance...
> >
> > Jack
> >
> >
>
>
Received on Sun Aug 25 2002 - 02:41:09 CEST

Original text of this message