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: What is best way for time comparison.

Re: What is best way for time comparison.

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/07/01
Message-ID: <962461961.25456.0.pluto.d4ee154e@news.demon.nl>#1/1

Faced a similar problem once. The date was really unimportant for me. At that time I decided to use my own birthday as a constant date. This would also leave 'traces' of my existence, might I be leaving or be kicked out (I was kicked out). Worked very well!

Hth,

Sybrand Bakker, Oracle DBA

"Ethan Post" <epost1_at_my-deja.com> wrote in message news:8jj3qe$tmi$1_at_nnrp1.deja.com...
> I have a table with 2 columns:
>
> met_val_begin
> met_val_end
>
> I want to store a time of day value, for example, 8:00 and 18:00.
>
> Then I want to write some sql that basically says
>
> select * from table where current_time is between met_val_begin and
> met_val_end;
>
> at the moment I'm doing it like this:
>
> ...where sysdate between
> TO_DATE(TRUNC(SYSDATE) || ' ' || met_val_begin, 'DD-MON-RR HH24:MI')
> and
> TO_DATE(TRUNC(SYSDATE) || ' ' || met_val_end, 'DD-MON-RR HH24:MI')
>
> but that looks a bit hacked to me, any suggestions?
>
> -Ethan
> http://www.freetechnicaltraining.com
> http://www.gnumetrics.com
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sat Jul 01 2000 - 00:00:00 CDT

Original text of this message

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