Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to select within a time range
Ramon F Herrera wrote:
> 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?
In Oracle all "DATE" fields are expressed in DAYs or
fractions thereof.
TRUNC(CALL_DATE) will contain only the "whole day" portion.
v_fulldate := TRUNC(call_date) + to_date('03:15:20','HH24:MI:SS');
Understand?
When all else fails, RTFM!
HTH & YMMV HAND! Received on Sat Jun 07 2003 - 16:10:50 CDT
![]() |
![]() |