Re: How extract time values from date fields?
From: Maarten Meijer <M.Meijer_at_accu.uu.nl>
Date: Mon, 18 Jan 1999 08:06:33 +0000
Message-ID: <36A2F999.64B648F0_at_accu.uu.nl>
Date: Mon, 18 Jan 1999 08:06:33 +0000
Message-ID: <36A2F999.64B648F0_at_accu.uu.nl>
[I] wrote:
>
> Hello Oracle programmers,
> Could anyone solve this little problem? In a PL/SQL program,
> I'm trying to
>
> select ... from ...
> where time0 between time1 and time2
>
> time0, time1 and time2 are of type DATE, but I'm only interested
> in the time portion of these dates!
> Since time0 is being input by a user, the date portion of time0
> is set to the first of the current month and year, while time1
> and time2 can have other month and year values.
> So how do I ignore these day, month and year values??
>
Thank you all for replying! The solution appears to be usage of
to_char(time,'HH24:MI') for all time-variables, which leads to a
comparison of strings instead of dates, but with the leading zeros
this works.
-- Maarten Meijer (030)2531660/2805001 http://www.accu.nl/~mmeijer ACCU (Academisch Computercentrum Utrecht) fax (030)2531633 Budapestlaan 6, P.O.Box 80011, 3508 TA Utrecht NLReceived on Mon Jan 18 1999 - 09:06:33 CET