Day ( Date ( 2 ; 0 ; 2012 ) )
will return the number of days in January, 2011.
So as long as you have a number for the month and the year, this is simple: Day ( Date ( MonthNumber + 1 ; 0 ; year ) )
If you want to select the month by name, you may need to use this calculation to get a month number from the month name:
Ceiling ( Position ( "JanFebMarAprMayJunJulAugSepOctNovDec" ; Left ( MonthName ; 3 ) ; 1 ; 1 ) / 3 )