Re: DATE column difference in minutes.

From: <sampsonr_at_spamfool.xyz>
Date: 1997/05/23
Message-ID: <3385ca9a.963837334_at_news.spry.com>#1/1


On Thu, 22 May 1997 14:36:28 -0700, Guna Govind <guna_at_gwcom.com> wrote:

> I'm using Oracle7.3 on Solaris 2.5.1.
>I need to calculate the time difference in minutes from 2 character
>strings (basically the timestamp is stored in a 'C' program
>as a charcter string). I tried to convert the character string
>to "date" format using "to_date", and subtracted them. But it always
>subtracts the date portion of the timestamp, but not the time.That is,
>if I subtract two different times on the same date, I always
>get '0'.
>

I tried this in SQLPlus and it works fine. See the following code:

SQL>
  1 select
  2 to_date('12-JAN-97 15:32', 'DD-MON-YY HH24:MI') -   3 to_date('12-JAN-97 13:44', 'DD-MON-YY HH24:MI') "Diff"   4* from dual
SQL> /         Diff


      .075

How about posting the code that's not working for you.

R M Sampson
sampsonr_at_ncr.disa.mil Received on Fri May 23 1997 - 00:00:00 CEST

Original text of this message