Date Arithmetic with Queries

When you work with dates, be aware that date arithmetic is not passed through to your external DBMS. For example, suppose that you want to calculate a person’s age as the difference between the current date and their birth date. If you include this calculation as part of a query, the data from your DBMS would be pulled first into SAS so that the calculation can be done. Therefore, it is recommended that you avoid using date arithmetic when you query an external DBMS.

Last updated: February 3, 2026