Hello,
I wish to convert these string dates, in which the MM and DD may be either 1 or two digits. The following two commands have been unsuccessful:
todate mydate, gen(statadate) p(ddmmyyyy)
returns error "length does not match pattern"
gen statadate = date(mydate, "DDMMYYYY")
generates missing values
Any advice/corrections would be most appreciated.
I wish to convert these string dates, in which the MM and DD may be either 1 or two digits. The following two commands have been unsuccessful:
todate mydate, gen(statadate) p(ddmmyyyy)
returns error "length does not match pattern"
gen statadate = date(mydate, "DDMMYYYY")
generates missing values
Any advice/corrections would be most appreciated.
Comment