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

Home -> Community -> Usenet -> c.d.o.tools -> Re: time calc from date, sysdate & number fields

Re: time calc from date, sysdate & number fields

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Wed, 13 Sep 2000 10:47:04 +0200
Message-ID: <8pngsu$5h0$1@s1.read.news.oleane.net>

Example with:
date field = 09-12-2000 12:00
quota = 40.25 hours

Results are in seconds:

v734>select sysdate,

  2         (sysdate-to_date('09-12-2000 12:00', 'MM-DD-YYYY HH24:MI'))
  3          *86400 "Elapsed",
  4         (40.25/24-
  5          (sysdate-to_date('09-12-2000 12:00', 'MM-DD-YYYY HH24:MI')))
  6         *86400 "Quota left"

  7 from dual;
SYSDATE                Elapsed Quota left
------------------- ---------- ----------
09-13-2000 10:46         81984      62916

1 row selected.

--
Have a nice day
Michel


Glen Stromquist <glenstr_at_my-deja.com> a écrit dans le message : 8plrbl$23t$1_at_nnrp1.deja.com...

> I am trying to design a query that will take a date field in a table,
> subtract it from sysdate to show elapsed time, which will then be
> subtracted from a number field that has allowed hours & minutes in
> 99.99 format. (number (5,2))
>
> Any suggestions on how best to do this?
>
>
>
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Sep 13 2000 - 03:47:04 CDT

Original text of this message

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