Hello friends,
I am currently using data that has one variable that shows the value of the date, for example, a variable named effective_date shows the value 20120105 means 2012-January-5th. If I only need the value of year (for my analysis purpose, as I need to create an arrival cohort based on years, not the exact date).
Right now I recode it like (20120000/20129999 = 2012), It works, but I am curious is there a way to formate variable just show the first four digitals instead of recoding it?
Please advise
Thanks
0 Response to Is there a way to format variable?
Post a Comment