Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with SQL DATE() function..

 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving from Servlets to JDBC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic