Hello,
First, sorry if this question has already been solved. I researched it but I did not found it.
I would like to pick up the year of a date. This is an example of what I have:
After looking around, I think one of the possible solutions is to use date() function, but it is not working as it just gives missing:
Any ideas?
First, sorry if this question has already been solved. I researched it but I did not found it.
I would like to pick up the year of a date. This is an example of what I have:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9 dateintr "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "2-Jul-03" "2-Jul-03" "2-Jul-03" "2-Jul-03" "2-Jul-03" "2-Jul-03" "2-Jul-03" "2-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "23-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "12-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "7-Jul-03" "7-Jul-03" "7-Jul-03" "7-Jul-03" "7-Jul-03" "7-Jul-03" "7-Jul-03" "7-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "17-Jul-03" "18-Jul-03" "18-Jul-03" "17-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "22-Jun-03" "22-Jun-03" "22-Jun-03" "22-Jun-03" "22-Jun-03" "22-Jun-03" "22-Jun-03" "22-Jun-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "17-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "18-Jul-03" "19-Jul-03" "19-Jul-03" "19-Jul-03" "19-Jul-03" end
After looking around, I think one of the possible solutions is to use date() function, but it is not working as it just gives missing:
Code:
gen year=date(dateintr, "DMY")
Comment