Hello,
I have been trying to convert a string variable first_date into a date format with multiple methods and failing.
When using the command
gen first_date = date(start_date, "DMY")
format first_date %tddd/mm/CCYY
the majority of observations are missing values. Those that are converted are done so wrongly, for instance 9/0/2014 instead of 9/10/2014. I have noticed that the missing values are generated for all dates with double-digit days, for instance 11/25/2014 is a missing value in the date format.
I have checked that the string variable does not have any mistakes in it, and it was imported from an Excel file, in which it was in date format.
Thanks in advance for your help!
Related Posts with Converting string to date without any missing values
Event Study errorsHi all!! I just started using STATA and I'm learning how to use the software on my own - which is n…
Dropping data framesHello All, just a quick question: is there any deep underlying reason why I can do Code: drop var1…
Record-to-date value in a time series or panelI will illustrate my question with an example. Say I have a variable called Temperature for 100 yea…
Statistically compare two proportions on multiply imputed dataDear all, I calculated two proprtions based on 50 multiply imputed datasets and received the follow…
Merging Refinitiv ESG data with Compustat dataHi Stata experts, I am trying to merge Refinitiv ESG data Compustat data. ESG data has 8 digit cusi…
Subscribe to:
Post Comments (Atom)
0 Response to Converting string to date without any missing values
Post a Comment