Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to select within a time range
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 := 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