I need to change the dates in my dataset from a month/day/year format to just a year. I can't figure out a way to do this without it being manual. Does anyone have any advice?
-
Login or Register
- Log in with
gen year= year(datevar)
format datevar %tdCY
gen wanted= inrange(year(datevar), 2005, 2010)
Comment