What is the problem with the mysql syntax
SELECT FORMAT(dCreatedDate,'YYYY-MM-DD') as date1 FROM tbl_book_self
I want to select the date from mysql database in this format,How to use this syntax
What is the problem with the mysql syntax SELECT FORMAT(dCreatedDate,’YYYY-MM-DD’) as date1 FROM tbl_book_self
Share
Did you mean to use
DATE_FORMATrather than justFORMAT?Also the format needs to be specified using
%notation so the corrected version of your example would beYou can find a list of the specifiers you can use in the format string in the MySQL documentation on Date and Time Functions.