dbTalk Databases Forums  

Adding days in Oracle 8.1.x

comp.databases.oracle.server comp.databases.oracle.server


Discuss Adding days in Oracle 8.1.x in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Miskiewicz
 
Posts: n/a

Default Adding days in Oracle 8.1.x - 10-25-2003 , 02:08 PM






Hallo!

Can someone tell me please how to add days to a given date in Oracle 8?
I'm checked the SQL Reference, but I can find a function like that. Is this
possible?



Regards

Thomas



Reply With Quote
  #2  
Old   
Tom Miskiewicz
 
Posts: n/a

Default Re: Adding days in Oracle 8.1.x - 10-25-2003 , 02:24 PM






Hi!

The following statement seems to work:

select to_date('31.10.2003','DD MM YYYY')+1 from dual;

In my environment I will replace the 31.10.2003 with a variable. Is this way
of doing it ok, or are there alternatives?


Thanks
Tom



Reply With Quote
  #3  
Old   
Jim Kennedy
 
Posts: n/a

Default Re: Adding days in Oracle 8.1.x - 10-25-2003 , 04:06 PM



If the column is a date then just +1 to add 1 day. eg
select myDate+1 from mytab ...
Jim
"Tom Miskiewicz" <miskiewicz2 (AT) yahoo (DOT) com> wrote

Quote:
Hi!

The following statement seems to work:

select to_date('31.10.2003','DD MM YYYY')+1 from dual;

In my environment I will replace the 31.10.2003 with a variable. Is this
way
of doing it ok, or are there alternatives?


Thanks
Tom





Reply With Quote
  #4  
Old   
Burt Peltier
 
Posts: n/a

Default Re: Adding days in Oracle 8.1.x - 10-25-2003 , 04:10 PM



That is it. Just add 1 to any date datatype and you get the next day.

FYI.. there are several functions for dates for things like adding months,
rounding, truncating, etc...

For more info on Oracle8i, see docs at:

http://download-east.oracle.com/docs...ion.htm#998166



"Tom Miskiewicz" <miskiewicz2 (AT) yahoo (DOT) com> wrote

Quote:
Hi!

The following statement seems to work:

select to_date('31.10.2003','DD MM YYYY')+1 from dual;

In my environment I will replace the 31.10.2003 with a variable. Is this
way
of doing it ok, or are there alternatives?


Thanks
Tom





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.