I have a query that looks good to me but MySQL does not agree. I am using the DATE_FORMAT function and I do not see what is incorrect so I am hoping some one can point it out.

SELECT title, DATE_FORMAT(event_date '%Y-%c-%e') AS event_date FROM event WHERE event_date LIKE '2010-01'
Query : SELECT title, DATE_FORMAT(event_date '%Y-%c-%e') AS event_date FROM event WHERE event_date LIKE '2010-01' 
Error Code : 1582
Incorrect parameter count in the call to native function 'DATE_FORMAT'
Execution Time : 00:00:00:000
Transfer Time  : 00:00:00:000
Total Time     : 00:00:00:000

Hi,

You have missed the "," (comma) in the query. Modify the query as,

SELECT title, DATE_FORMAT(event_date[B],[/B]'%Y-%c-%e') AS event_date FROM event WHERE event_date LIKE '2010-01'

Good luck.

Ouch!, good eyes.
Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.