BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Posterne
Fluorite | Level 6

Hi All,

 

I'm currently trying to write a script that will help me bill people staying at some appartments. I am only billing for one month at a time, so i have set a first day of interest and a last day of interest. What I'm struggling with, is billing those who haven't stayed the full month. How do i count the days between first day of interest and last day of interest when some people have moved in after first day and some have moved out before last day (and even some have done both)?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You would use the intck function with parameter 'day':

http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1md4mx2crz...

 

or if your two dates are numeric dates, then subtracting the smaller from the larger will result in the days difference, as SAS stores dates as number of days since the cuttoff point.

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You would use the intck function with parameter 'day':

http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1md4mx2crz...

 

or if your two dates are numeric dates, then subtracting the smaller from the larger will result in the days difference, as SAS stores dates as number of days since the cuttoff point.

Posterne
Fluorite | Level 6
Thanks! This community is amazing

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 2 replies
  • 1062 views
  • 0 likes
  • 2 in conversation