Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Add hours and minutes to date

Re: Add hours and minutes to date

From: Rodd Holman <rodney.holman_at_lodgenet.com>
Date: Tue, 31 Jul 2001 09:43:53 -0700
Message-ID: <F001.0035A52A.20010731091609@fatcity.com>

Try

select date+(hours/24)+(minutes/60/24)

this would give you the decimal equivalent of the hours and minutes added to your date field for a time stamp type output.  This assumes that your date field is a date datatype and that all entries are for date 00:00 and not just a sysdate input.

Rodd

On 31 Jul 2001 08:31:06 -0800, John Dunn wrote:> I have 2 varchar2 variables, one containing a number of hours and the other
> containing a number of minutes, which I want to add to a date variable.
>
> How can I do this?
>
> John
>
>
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: John Dunn
> INET: john.dunn_at_sefas.co.uk
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Received on Tue Jul 31 2001 - 11:43:53 CDT

Original text of this message

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