简体   繁体   中英

Retrieving Month and Year from a date in SAS

I am comparing dates from two tables. Values1 = 28/07/2020 Values2 = 26/06/2020 I tried using the intnx function. it doesnt provide the right results. it should compare only the month and year and spit out the differences

intnx is for advancing or retreating a date value to another date value.

The correct function for computing intervals is INTCK .

* variables contain SAS date values;

month_diff = intck ('month', values1, values2);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM