aspose file tools*
The moose likes JDBC and the fly likes Problem with SQL DATE() function.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem with SQL DATE() function.." Watch "Problem with SQL DATE() function.." New topic
Author

Problem with SQL DATE() function..

Ivan Jouikov
Ranch Hand

Joined: Jul 22, 2003
Posts: 269
DATE() and related functions don't seem to work:
->SELECT TIMESTAMP('2003-12-31');
[Comp Root] ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('2003-12-31')' at line 1
->SELECT DATE('2003-12-31 01:02:03');
[Comp Root] ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '('2003-12-31 01:02:03')' at line 1
However things like SELECT DAYOFWEEK('1998-02-03'); do work... any ideas?
I am using MySQL latest stable release
Faisal Khan
Ranch Hand

Joined: Jun 29, 2003
Posts: 285
Hi Ivan,
The DATE() and TIMESTAMP() functions are not available in latest stable releases. These functions are available in 4.1.1 (which is Alpha at the moment). This is clearly stated in the MySQL Manual.
Furthermore, you have posted this question in the wrong place, since this has nothing to do with servlets.
For details read: http://www.mysql.com/doc/en/Date_and_time_functions.html
HTH


The secret to creativity is knowing how to hide your sources.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Moving from Servlets to JDBC.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with SQL DATE() function..
 
Similar Threads
simple Update fail
prepared statement -select- and?
using MySql
how to create MySql stored procedure?
getting error while working Stored procedure?