Hello, I'm trying to merge two datasets using a variable called sur_mon_yr that is month/year. E.g. 01/2010
When merging by sur_mon_yr, there is no match.
I suspect this is because one dataset has sur_mon_yr in %tmNN/CCYY format whereas the other dataset uses %tdNN/CCYY format.
I tried changing the format of the variables to match but it's not working.
For example, if %tdNN/CCYY is changed to %tmNN/CCYY, the observation changes from 01/2010 to 01/3497.
On the other hand, if %tmNN/CCYY is changed to %tdNN/CCYY, the observation changes from 01/2020 to 08/1961.
I'm not sure how to get the two sur_mon_yr variables to have the same format such that they can merge and match.
Many thanks for your help,
Harry
Related Posts with Date format question
Current timezoneI would like to know if it is possible to obtain the current timezone (offset in hours/minutes) of t…
cascading flag variablesHi there Any advice on an easy way to code the following would be greatly appreciated. Code: clea…
Reverse geocoding with geoinpoly gives inaccurate results helpHello, I am trying to use geoinpoly to extract countries from coordinates. I am using the 'PDSI - M…
Homogeneity and symmetry condition in LA-AIDS in stata command suregDear community, I want to estimate LA-AIDS with homogeneity and symmetry conditions imposed. I have …
Problem with Stata's parsing of command options in graphical commandsDear All, I suspect a bug in Stata's parsing of command options in graphical commands. Can someone c…
Subscribe to:
Post Comments (Atom)
0 Response to Date format question
Post a Comment