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: Ana C. Dent <anacedent_at_hotmail.com>
Date: Sat, 07 Jun 2003 14:10:50 -0700
Message-ID: <sxsEa.63693$MJ5.14525@fed1read03>


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

Original text of this message

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