Months Between two dates

Accepted Solution Solved
Reply
Contributor
Posts: 40
Accepted Solution

Months Between two dates

Hi

Is anyone aware of a SAS function which will give the number of months between two dates ?


Accepted Solutions
Solution
‎01-07-2015 02:44 AM
Frequent Contributor
Posts: 77

Re: Months Between two dates

x = intck("month",'01JAN14'd,'01OCT14'd);

View solution in original post


All Replies
Super User
Posts: 9,867

Re: Months Between two dates

intnx( . )

Solution
‎01-07-2015 02:44 AM
Frequent Contributor
Posts: 77

Re: Months Between two dates

x = intck("month",'01JAN14'd,'01OCT14'd);

Contributor
Posts: 40

Re: Months Between two dates

Thanks Tarun - perfect

Frequent Contributor
Posts: 115

Re: Months Between two dates

data _null_;

date1='01JAN14'd;

date2='01OCT14'd;

x = intck("month",date1,date2);

y=month(date2)-month(date1);

put x= y= ;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 1150 views
  • 0 likes
  • 4 in conversation