Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Simple date arithmetic
just so you know, the 1/2/24 is a mathematical calculation (1 divided by 2 divided by 24) rather than the date Jan 2, 1924.
<tedchyn_at_yahoo.com> wrote in message news:8tdoih$1ff$1_at_nnrp1.deja.com...
> here it is:
> SQL> select to_char(sysdate - 1/2/24,'mm:dd:yyyy hh24:mi:ss') from dual;
>
> TO_CHAR(SYSDATE-1/2
> -------------------
> 10:28:2000 01:06:24
>
> SQL> select to_char(sysdate,'mm:dd:yyyy hh24:mi:ss') from dual;
>
> TO_CHAR(SYSDATE,'MM
> -------------------
> 10:28:2000 01:36:57
>
> ted chyn
> In article <8td2io$h8m$1_at_nnrp1.deja.com>,
> rasx_at_my-deja.com wrote:
> > 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.
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sat Oct 28 2000 - 06:40:53 CDT