From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions

Unlock this course with a free trial

Join today to access over 22,700 courses taught by industry experts.

Calculating date intervals

Calculating date intervals

- [Instructor] Suppose you need to count the number of some time interval, such as weeks, weekdays or months that have occurred between a start and end date. You can use the INTCK function to return the number of interval boundaries of a given time period that occur between two dates. The syntax for the INTCK function begins with the time interval you want to count. Examples of intervals are year, month, week or weekday. The second argument is the start date, and the third argument is the end date. The optional fourth argument defines the calculation method. Let's look at the start and end date for a storm in 2017 that began on the 21st of July, and ended on the 31st of July. Let's consider these dates on a calendar. How many weeks passed between these two dates? It depends on when one week ends and the next week begins. One option is to count the number of standard interval boundaries that occur between the dates. A…

Contents