Quote:
Originally Posted by don_log
I want to get only month inserted in a table
and the query to insert month in every row suppose it have 22 rows in my table
so it gets only month name like march or january ,whatever months but current month
and i also want to convert data in this format 23-12-2010
in mysql while fetching rows and inserting rows
|
You can fetch only mounth from datatime colum whit this query :
Code:
SELECT DATE_FORMAT(column_name, '%M') AS date FROM`tavleName`";
}
so, to convert dateformat from
ISO format YYYY-MM-DD to
DD-MM-YYYY you have to do this in your queries :
Code:
SELECT DATE_FORMAT(column_name, '%d-%m-%Y') AS date FROM`tavleName`";
}
You can check here about information for
Date and Time Functions