Hi all, I am having problems finding the right coding commands to convert a variable in my data set (deliverydate, which is in M,D,Y format) into a new variable (deliveryyear, which I want in Y format).
Any suggestions?
Any suggestions?
gen int deliveryyear = real(substr(deliverydate, -4, 4))
gen int deliveryyear = year(deliverydate)
Comment