Sql Query to get Two digit Month Number
by Mohan[ Edit ] 2014-06-18 15:13:24
Sql Query to get Two digit Month Number
In general ,
SELECT MONTH( CURDATE( ) )
returns month number in one digit for months upto september.
To get two digit number, you can use the following sql query
select RIGHT( CAST( 100 + MONTH( CURDATE( ) ) AS CHAR( 3 ) ) , 2 ) as monthnum
it will return two digit month number.