This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes SQL date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL date" Watch "SQL date" New topic
Author

SQL date

Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Hi,
In SQL, using CURRENT DATE, we can get the current date, for example, '2002-10-29'.
How can we get a date that is 100 days earlier than current date? (using SQL only)


Thanks,<br />Mike
Les Dsouza
Greenhorn

Joined: Jan 29, 2002
Posts: 27
select sysdate-100 from dual;
or
select current_date-100 from dual;
This works in oracle.
regards.
[ October 30, 2002: Message edited by: Les Dsouza ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SQL date