How to convert char(date) to date to get noumber of months
How to convert char(date) to date to get noumber of months
(OP)
Hi
I have text columns
date1 = 20135 (2013 is year and 5 is month)
date2 = 20109 (2010 is year and 9 is month)
I want to convert text in to date to get the number of months
I am using proc sql any idea how to do this in proc sql?
thanks
I have text columns
date1 = 20135 (2013 is year and 5 is month)
date2 = 20109 (2010 is year and 9 is month)
I want to convert text in to date to get the number of months
I am using proc sql any idea how to do this in proc sql?
thanks
RE: How to convert char(date) to date to get noumber of months
So in your case May 1, 2013
Here is an example that presumes that your variable with the '20135' value is named mydate.
proc sql;
create table test as
select *, input(mydate, yymmn6.) as mynewdate
from mydataset
;
quit;
I hope that this helps you.
Klaz