-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mufaddal Khumri wrote:
I am using JDBC and trying to run this query.
Select DISTINCT COURSE.ID, COURSE.NAME, COURSE.CATEGORYID, COURSE.DESCRIPTION " +
"COURSE.GRADELEVELS, COURSE.OWNERID from MEETING, COURSE, INSTRUCTOR " +
"Where INSTURCTOR.ID = 1 And COURSE.INSTRUCTORID = INSTRUCTOR.ID And " +
"Meeting.COURSEID = COURSE.ID And MEETING.STARTDATE <= CURRENTDATE <= MEETING.ENDDATE"


Basically I am trying to get the Courses from the course table where CURRENTDATE is between Meeting.STARTDATE AND Meeting.ENDDATE. CURRENTDATE is of type java.sql.Date. Am I comparing the dates correctly ? ie. can i use logical operators or is there a function in mysql to compare the DATES ?

Thanks.


You don't say what your error is, so I don't know how much help I can be.

However, you do know that java.sql.Date has _no_ time information in it, don't you? If you're expecting to find something based on time information, you need to use the DATETIME or TIMESTAMP type in MySQL, and use java.sql.Timestamp in JDBC.

-Mark


- -- MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/


For technical support contracts, visit https://order.mysql.com/?ref=mmma

    __  ___     ___ ____  __
   /  |/  /_ __/ __/ __ \/ /  Mark Matthews <[EMAIL PROTECTED]>
  / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
 /_/  /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
        <___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+ZN1btvXNTca6JD8RAvO9AJ4zP0LXJXTiHZnmBmUZLWsxSbbYxACeJSbG
aBsPT58PqqviDLj7bYqXTBI=
=9KIA
-----END PGP SIGNATURE-----


--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to