tags:

views:

71

answers:

4

All,

I need to retrieve the date in some specific format in MYSQL. For eg,

it should return month/year(10/2009).

My MYSQL version is 5.1.

Thanks, Srinivasan.

+1  A: 

DATE_FORMAT function

DATE_FORMAT(col,'%m/%Y')
Svetlozar Angelov
A: 

Check the documentation for this function in MySQL

DATE_FORMAT(date, format)

DATE_FORMAT('%m/%Y', col)
jitter
+1  A: 
date_format(yourdatefield, '%c/%Y') as formatted_date

will do that- http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function%5Fdate-format

Pete Jordan
A: 

This website will help you format the date using the mysql date_format function http://www.mysqlformatdate.com

gerard