Using QMF

Finding the number of days between two dates

The DAYS function calculates the number of days between one date and another. You can do this with an equation such as this one:

DAYS (future date) - DAYS (&DATE)

&DATE supplies the current date.

The DAYS function returns an integer representation of a date. The result of DAYS is the number of days since December 31, 0000. (There is no year 0000. This convention ensures that all days in the range of years 0001 to 9999 are included.) The argument can be a date, a timestamp, or a string representation of a date. For example, if you run this statement:

DAYS('0002-01-03')

The result is 368 days.

The DAYS function allows you to be more precise in date/time arithmetic. See the QMF Reference, SC26-4716-05 for a more detailed explanation.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]