Hello,
My date variable looks like the following. I have tried using this command but it gives me a mismatch error.
May I get the correct way to extract year from my date variable ?
I used this code below to extract year and got the error
dataex date
----------------------- copy starting from the next line -----------------------
My date variable looks like the following. I have tried using this command but it gives me a mismatch error.
May I get the correct way to extract year from my date variable ?
I used this code below to extract year and got the error
Code:
gen year=year(date) type mismatch r(109);
dataex date
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str10 date "2000-11-29" "2000-11-29" "2000-12-01" "2000-11-29" "2000-12-01" "2000-12-01" end
Comment