Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To get the date one week from current date

 
pavani potnuru
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need the get the currentdate+1 week . So that I can compare with another date which i get from database. Help me out in this. I have Oracle 9i. I need a query compatible to this version.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could do this easily in Java using the Calendar class. Does it need to be part of the query? Any Oracle solution you come up with is going to be pretty non-portable.
[ January 16, 2008: Message edited by: Scott Selikoff ]
 
Paul Campbell
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Selikoff:
You could do this easily in Java using the Calendar class. Does it need to be part of the query? Any Oracle solution you come up with is going to be pretty non-portable.

[ January 16, 2008: Message edited by: Scott Selikoff ]


It's also pretty easy in almost any DBMS... there are differences... but they are all similar.

DB2

select current date + 7 day

Oracle

select sysdate + 7

mysql

SELECT CURDATE() + interval 7 day

or

SELECT DATEADD(currdate()interval 7 day)
[ January 16, 2008: Message edited by: Paul Campbell ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic