I have an unavoidable situation where the dates are stored in UK date format, e.g.:
31/12/2001 00:00:00
I need it in descending order, I’ve tried this but it errors
select *, DATE_FORMAT(completiondate,'\%e/%c/%Y\') as cdate
from projects
where countries = 1
order by cdate desc
Error:
check the manual that corresponds to your MySQL server version for the
the right syntax to use near ” order by cdate desc’
I’m using MySQL 4.1.9
You are escaping the
%character unnecessarily. But the actual problem is that that you have an un-terminated string literal in your query:Change to: