Dear all,

I am working with a large dataset of nearly 3 million observations on house prices in the UK.
The data has date in the following format as an example in excel: "28/01/2020 00:00".
And when importing to Stata, the format changes to the following format as an example: "28jan2020 00:00".

But, I need to sort the data into the following format: "2020 m1" or "jan2020" etc.

I have already tried to use the following code from a previous post
Code:
gen monthly_date = mofd(Date)
format monthly_date %tm
but when running it, the command "tab monthly_date" gives no observations.

The link to the post which may be relevant is here.
https://www.statalist.org/forums/for...o-monthly-data

If anyone has any suggestions on how to go about this I'd greatly appreciate it.

I am using Stata 15.1 for Windows 10.

Many thanks in advance,
James.