Dr. Dio
Dr. Dio

Reputation: 9

Issues with Date Format() Function

Here is my code:

SELECT b.id, b.user_id, DATE_FORMAT(b.fecha, '%m/%d/%y'), b.titulo, b.contenido, m.name
          FROM blog b, miembros m 
          WHERE b.user_id = m.userID
          ORDER BY b.id DESC

Im trying to get b.fecha value, that actually is 2014-05-21, and make it to 05-12-2014. however it wont get the value. How is the correct way to write it?

Upvotes: 0

Views: 97

Answers (1)

Abhik Chakraborty
Abhik Chakraborty

Reputation: 44844

This is how you can do for 2014-05-21 and make it to 05-12-2014

DATE_FORMAT(b.fecha, '%m-%d-%Y') as fecha

Upvotes: 3

Related Questions