Each record contains the date in various formats plus the date number following the same numbering as Excel. To determine the number of days between two dates we chain to the file with each of the dates and subtract one date number from the other. Not at all elegant but it works and has proven very handy. Use of this file has dropped off in recent years but we still use it occasionally for situations such as you describe.

If you want to know a date 30 days from today, just get today’s date number from the file, add 30 to it and retrieve the new date using the new date number as the key.

Again, this a really old school but it works nicely in some applications like query.

]]>OLDESTCHR1 substr(chr1,1,4) || ‘-’ ||

substr(chr1,5,2) || ‘-’ ||

substr(chr1,7,2)

(change the start positions accordingly).

Do the above for both date fields.

DATECHRDIF date(OLDESTCHR2) –

date(OLDESTCHR1)

This will give you the number of days between two dates (0 days when dates are the same).

If the fields are already defined as date (in YYYY-MM-DD format) then the formula is as follows:

DATEDIFF DateField2 – DateField1