Dear experts,
I am trying to convert string-type datatype to date type
First I tried to force the date column of csv file to numeric but it turns out that all cells are missing,
Therefore I input the data to the Stata dta and have a sample as below
I have tried a couple of approaches around following some topics here but there is nothing works so far.


Many thanks and best regards,
I am trying to convert string-type datatype to date type
First I tried to force the date column of csv file to numeric but it turns out that all cells are missing,
Therefore I input the data to the Stata dta and have a sample as below
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str18 country str10 date str20 id "Argentina" "2021-08-31" "Argentina_1" "Argentina" "2021-09-01" "Argentina_1" "Argentina" "2021-09-02" "Argentina_1" "Argentina" "2021-09-03" "Argentina_1" "Argentina" "2021-09-06" "Argentina_1" "Argentina" "2021-09-07" "Argentina_1" "Argentina" "2021-09-08" "Argentina_1" "Argentina" "2021-09-09" "Argentina_1" "Argentina" "2021-09-10" "Argentina_1" end
Code:
generate numdate = date(date, "MDY") format numdate %td
Code:
generate numdate1 = date(date, "MDY")
Many thanks and best regards,
Comment