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: Simple date arithmetic

Re: Simple date arithmetic

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 28 Oct 2000 06:42:25 +0200
Message-ID: <972737846.11771.0.pluto.d4ee154e@news.demon.nl>

select sysdate - (30 / (24*60))
from dual;

dates are measured in days, the above fraction is expressing 30 minutes, as there are 24 hours in a day and 60 minutes in each hour. Hth,

Sybrand Bakker, Oracle DBA

<rasx_at_my-deja.com> wrote in message news:8td2io$h8m$1_at_nnrp1.deja.com...
> As a product of MS SQL Server culture, I am at a significant loss when
> trying to do simple date arithmetic in Oracle 7.
>
> For example, how do I shave off 30 minutes from SYSDATE?
>
> This does not seems to work:
>
> SELECT SYSDATE - TO_DATE(30,'MI') OUT FROM DUAL;
>
> Do I need to use a TO_CHAR() somewhere?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Oct 27 2000 - 23:42:25 CDT

Original text of this message

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