ndays

Syntax

days = NDAYS(date)

Arguments

days: integer

date: text

Meaning

NDAYS returns the number of days between 1 January 1900 and date. A negative number is given if date is before 1900. The parameter date must be a date in the Julian (yyyy.ddd, not supported in Axiell Collections), European (dd/mm/yyyy, Collections also supports dd-mm-yyyy), or ISO (yyyy-mm-dd) notation. The USA format is not supported.

If an invalid date is entered, days gets the value 0, and the system tag &E (which indicates whether an operation has been successful) is set to 5. It is therefore a good idea to check the contents of &E after carrying out the NDAYS function. If the date string is empty, you'll get a "String was not recognized as a valid DateTime" error.

The NDAYS function only works reliably on dates after september 1752, when a new calendar was introduced.

For date you can also use 'today' or date$(<code>). The system will then automatically fill in the value that applies at the time the ADAPL is executed. It is also possible to combine 'today' or date$(<code>) with a plus or minus sign followed by an integer (For Adlib for Windows e.g. 'today' - 10 and for Axiell Collections e.g. 'today -10'). This represents the system date plus or minus the number of days indicated.

Example

days = NDAYS('05/12/1992')

Result

days is 33941

See also

DATE$