Hello,
I have the following question.
I have a date string variable (DDDDMMYY) and I want to extract the number of the month in a year. So January would be a 1, February a 2, etc. In the next year the number of the months should keep on numbering (the data ranges from January 2012 till December 2016). So if January 2012 is month number 1, then January 2013 should be month number 13. I also want to do this for year. So 2012 should be year number 1, 2013 number 2, etc.
Below is an extract of the date variable.
Your help would be much appreciated!
Best,
Maarten
I have the following question.
I have a date string variable (DDDDMMYY) and I want to extract the number of the month in a year. So January would be a 1, February a 2, etc. In the next year the number of the months should keep on numbering (the data ranges from January 2012 till December 2016). So if January 2012 is month number 1, then January 2013 should be month number 13. I also want to do this for year. So 2012 should be year number 1, 2013 number 2, etc.
Below is an extract of the date variable.
Code:
[* Example generated by -dataex-. To install: ssc install dataex clear input str10 maaltijddatumafgehaald "0018-06-12" "0024-10-12" "0009-11-12" "0022-10-15" "0020-09-13" "0005-02-13" "0003-09-12" "0029-12-12" "0016-10-13" "0026-07-12" "0027-01-16" "0004-11-12" "0029-08-12" "0013-02-14" "0011-09-12" "0010-02-16" "0030-09-12" "0001-05-14" "0003-10-12" end
Best,
Maarten
Comment