Yo!
 
You could try solving the problem by selecting the date column - 7 in the
sql query, i.e. 'select date_column -7 from foo_table'. It's been a long time
since I last used MySql, but I know for sure that it works in M$ Sql Server :)
 
Regarding the Date() problem, there is no constructor matching Date() in java.sql.Date.
(At least not in Java 2 1.3) There is, however, such a constructor in java.util.Date. Or you
could try using another constructor in java.sql.Date...
 
Cheers :)
 
/erik
-----Original Message-----
From: Ryan [mailto:[EMAIL PROTECTED]]
Sent: den 6 april 2001 14:18
To: [EMAIL PROTECTED]
Subject: Dates in Java

I have a simple question about the Date object (or similar object)
 
I have a mySQL table with a DATETIME cell. I want to get the date from this cell
 
(formatted like so: e.g.  2001-03-23 13:04:59)
 
 and retrieve the date that is exactly 7 days earlier than the retrieved date.
 
What is the easiest way to do this? I noticed a lot of method deprecations in the specs and I am having trouble using the Date object.
-----
For example,
DateTest.java:20: cannot resolve symbol
symbol  : constructor Date  ()
location: class java.sql.Date
                Date d = new Date();
                         ^
1 error
-----
 
thanx
-ryan

Reply via email to