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
Creating an expression that tells marginal impact of moving one independent variable to another independent variable.I have been working on a project over the last few months. The idea of this project is looking at ML…
calculating frequency of events by age-classHello stata-users, I need to create a two column dataset by age-class and number of events. I can d…
change from row to collumn without reshapehi I have a long data. i would like that each categorie of one variable "class" became a collumn, wi…
Dropping certain observations of a variable in a specified rangeI want to drop only certain observations of l_growth for each naic that are between 1997Q1 and 2009Q…
Counting Instance of a variable and returning averageI am a student and new to Stata. Any help is appreciated. I have a data set with age and weight. I …
Subscribe to:
Post Comments (Atom)
0 Response to Converting string to date without any missing values
Post a Comment