In command prompt of mysql 5.1 I am not able to use Date function.It tells syntax error. Can any buddy help me to solve this issue. In my local system where mysql version is 5.0 same command is working fine…!
I am confused what could be wrong with mysql 5.1.39 Is there any setting in my.cnf for date support.
SELECT date('2012-03-01 03:15:00')
Above command is giving error:
MySQL said:
#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 '('2012-03-01 03:15:00')' at line 1
Above command is not working in mysql 5.1.39 . Can you please help me regarding this?
Check ANSI_QUOTES sql mode if it is set –
From the reference: ANSI_QUOTES – Treat ‘”’ as an identifier quote character (like the ‘
’ quote character) and not as a string quote character. You can still use ‘’ to quote identifiers with this mode enabled. With ANSI_QUOTES enabled, you cannot use double quotes to quote literal strings, because it is interpreted as an identifier.Change ” quote with ‘, and execute –