Previous Topic: $INITTRANID FunctionNext Topic: $KEY Function


$INTERNALDATE Function

This is a numeric function that returns the CA Ideal internal integer date for the specified input date. The internal date represents the number of days difference between the input date and December 31, 1900.

This function has the following format:

$INTERNAL‑DATE(input‑date)
input‑date

Specifies the date used as input to the function. The input‑date can specify a literal or the name of an alphanumeric or numeric field containing the date. Specify the input‑date as follows:

{date‑field                                              }
{'literal'                                               }
{alpha‑date [,TEMPLATE='alpha‑input‑pattern'][,BASE=yyyy]}
{                                                        }
{num‑date [,TEMPLATE='num‑input‑pattern'] [,BASE=yyyy]   }
{MONTH=month, DAY=day, YEAR=year [,BASE=yyyy]            }

The input date is interpreted using the default format yymmdd and the BASE value or the format specified in the TEMPLATE clause when it includes a 4 digit year. For explanations of the input date options, see the section on the $DATE function in this chapter

Example

The following returns the internal integer format of the date stored in PAY_DATE in the format yymmd. If the year is less than 50, then the century is 20. If the year is greater than 50, then the century is 19.

$INTERNAL‑DATE(PAY_DATE,TEMPLATE='YYMMDD',BASE=1950)

The following function returns the internal integer format of the date literal 19940415 (April 15,1994), namely, 31151.

$INTERNAL‑DATE('19940415',TEMPLATE='YEARMMDD')