BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

@Cerium23 wrote:

How do I convert days to months? Can someone please help. 


Depends on what you mean.

Normally for generating statistics on number of months I like to just divide number of days by a constant like 30 than worry about the varying number of days in calendar months.  To get the difference in days between two dates just subtract them.

If you want to get real difference of calendar months between two dates you can use the INTCK() function with the MONTH interval.  But be careful as it counts the number of boundaries crossed.  So a difference of 30 days might return 0,1 or 2 boundaries crossed depending on the actual dates being compared.

If you just want to get the month within the year from a date value use the MONTH() function.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 15 replies
  • 5081 views
  • 1 like
  • 4 in conversation