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: How to select within a time range

Re: How to select within a time range

From: Ramon F Herrera <ramon_at_conexus.net>
Date: 7 Jun 2003 13:16:15 -0700
Message-ID: <c9bc36ff.0306071216.1c6b45e8@posting.google.com>


Thanks -one more time- for your help, Sybrand.

Even after some experimentation, I am still unclear on how to combine a date and a time. I have tried the follwing:

call_date     DATE;
call_time     CHAR(6);

v_FullDate DATE;

v_FullDate := tab.call_date + tab.call_time / 1000000;

However, the results are incorrect.

Could you, or anyone out there, please provide an example on how to add, say, 3 hours, 15 minutes and 20 seconds to a given DATE variable?

TIA, -Ramon

Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl> wrote in message news:<bv63evc4qelrl1tpapenqsvpvjd45in19u_at_4ax.com>...
> On 6 Jun 2003 22:43:09 -0700, ramon_at_conexus.net (Ramon F Herrera)
> wrote:
>
> >In Unix, I would convert all the dates to seconds, before checking
> >to see if a particular date falls inside the range, but how should
> >I do this in SQL? Should I change everything to seconds?
>
>
> You would need to understand a DATE column contains minutes and
> seconds and a second is just a fraction of a day.
> Hence you can subtract and compare them and nothing of the above is
> necessary.
>
>
> Sybrand Bakker, Senior Oracle DBA
>
Received on Sat Jun 07 2003 - 15:16:15 CDT

Original text of this message

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