Hello, I have 2 dates and I'm trying to get the difference between them in days. One is formatted as datetime20 and the other as date9. I've tried the following and neither works.
Format them both as date9 --> Error message, there was a problem with the format so best. was used. Not sure what best. format is or whether I needed to change the informat as well. Is the difference between 2 date9 variables come out in units of days?
data want; set have;
format evrprdttm date9.;
informat evrprdttm date9.;
days=intck('dtday', evrprdttm, adate);
run;
Reformat them both as numeric --> the revised dates come out as missing along with "diff"
data want; set have;
adate_revised=input(adate, mmddyy10.);
evrprdttm_revised=input(evrprdttm, mmddyy10.);
diff=evrprdttm_revised-adate_revised;
run;