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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 688 views
  • 0 likes
  • 2 in conversation