BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hi all,

I have a dataset called Adding_120A. It has EnteredAccountStatusDate column. I want to add a column which shows the number of days between EnteredAccountStatusDate and today's date. I have written a code but it adds a column but there is no data in the column. Below is the code I have written and the Note message from the log.

Data Adding_120A;
Set Adding_120A;
today=today();
No_of_days=intck('d',EnteredAccountStatusDate,today);
run;

NOTE: Invalid argument to function INTCK('d',23023,23064) at line 32 column 12.
3 REPLIES 3
Tom
Super User Tom
Super User

There is no interval named D that INTCK() understands.  Did you mean to use 'DAY'?

But if you have date values you can just subtract them to calculate day differences. Dates are stored as a number of days and you don't have to use INTCK() or INTNX() when the interval you are using is the basic storage unit of the values.

Sandeep77
Lapis Lazuli | Level 10

okay, I changed 'd 'with 'day' and now it is showing the number of days. Thanks