I have a data set with the variable date in it and it looks like this
Code:
date 19990106 20000425 19990930 ...
it is in this format currently:
Code:
storage display value variable name type format label variable label date long %12.0g
How can I convert it to a normal date, so I can substract other dates from it? Because I have a second date variable in this format, which I think should be correct?: (And it looks like 13sept1999 in the editor)
Code:
storage display value variable name type format label variable label event_date int %td event_date
I tried the following but I got an error:
Code:
. gen edate2 = date(date, "ymd") type mismatch r(109);
I'd be really thankful for any ideas, Thanks!

0 Response to Converting to a date from YMD
Post a Comment