Re: Dates?

From: Steve mouatt <steve_at_bedrockcomputers.demon.co.uk>
Date: Thu, 23 Jul 1998 12:49:40 +0100
Message-ID: <35B72354.13ED_at_bedrockcomputers.demon.co.uk>


Daniel Kosolofski wrote:
>
> I am used to using SQl Server and not
> Oracle so I am not totaly familiar with
> the systax.
>
> So on that note my question is how do
> you add/subtract dates (specifically
> hours) .
> E.g. ('02/jun/1998 12:00 A.M' - 3 hours)
> I know in SQL Server there is a dateadd
> function.
> Is there the same thing in oracle.
In Oracle you can perform simple arithmatic on dates to achieve this. Adding 1 to a date variable will add one day to the date. Thus adding 1/24 to a date will cause it to increment the date by 1 hour.

	eg 
		SELECT TO_CHAR(SYSDATE+(1/24*3),'DD_MON-RRRR HH24:MI:SS') FROM DUAL;
	
	will return the current time and date plus 3 hours.
HTH
	Steve

	SYSDATE+
Received on Thu Jul 23 1998 - 13:49:40 CEST

Original text of this message