i have problem with my query for date. i have date format for field value 30.05.2012. i want to change this format to 30/05/2012 but my query doesn’t work. can i know what wrong with my query?
This is my query:-
select DATE_FORMAT(P2, '%d/%m/%Y') from view_parameter a
where a.stateCode = 02 and a.schoolCode='SMSA'
You forgot a
%before your dEdit :
Oh, that’s a string that mysql can’t get as a Date : so
Edit 2 :
or simply (without check for valid dates which is made by STR_TO_DATE)