Data A_DateFrom;
set Agent_Hist;
DateFrom1=Datepart(DateFrom);
Format DateFrom1 date9.;
run;
First run proc contents
to see what is the type of DateFrom
:
proc contents data=Agent_Hist;
run;
I suspect it may be character. In that case first use input()
function:
data test;
DateFrom='2018-01-11 18:30:00.000';
DateFrom1 = input(DateFrom, yymmdd10.);
format DateFrom1 date11.;
run;