If you date information is entered correctly the following code should work for you:
gen monthonly = month(date)
If that doesn't work for you it's probably the date variable that not set up correctly, based on the information provided in your question I expect this will be a problem (hopefully I'm wrong). Try setting up a new date field.
I encounter this problem again. I have a date variable OCCURED_DT but when I try to extract the year: gen year= year(OCCURED_DT) and got the following message: (218 missing values generated). IT is not working. I have a date variable, why cant I use the year command? Any ideas?
storage display value
variable name type format label variable label