Month of a date in MM format in mysql

357
Views
1
Answers

Hi,How to get a month of a date in 'MM' format

select month('20110101')

returns the month as'1' but I need in '01' format.Any suggestions?

edit | flag
William Patrick
Asked on: Aug 25, 2011 at 11:27PM

1 Answers

57
4
57

Try this..

Select date_format('20110101','%m')

This will return '01' . Cheers!!

edit | flag
William Patrick
Answered on: Aug 25, 2011 at 11:31PM

Post your Answer

Search

Welcome to Ask Amoeba!
This is 100% free and interactive site for sharing professional Questions and Answers, Opensource projects, Interview questions.
Learners, beginners, Experts stop and share your knowledge and ideas!

Browse Categories

Browse Tags