Products Downloads


French version


 


ADELIA

VADELIA

SADELIA

WADELIA

EADELIA

(I/B)

(I/B)

(B)

(I/B)

(B)


Description

This predefined function is used to calculate the interval (number of days) between two six-position dates.


Note: The century is calculated using a limit year. The calculation rule is as follows:

IF Year in date >= Limit year

Þ CENTURY = 19

ELSE

Þ CENTURY = 20


The default value of this limit year is 50. It can be changed as described below:

    • On AS/400 (Adelia iSeries RPG programs or AS/400 server part): by modifying the data area HA#LYC. The data area taken into account is the first found in the list of libraries. In the software supplied, it is stored in the HA#XRUN and HA2SLIB libraries.
    • On Windows (Windows client Visual Adelia programs or Windows server part, C-generated Adelia programs): by specifying it in the "Display" tab of the interface configuration tool (run confintw.exe).
    • In Java (Adelia Cloud client, Adelia Web client, Java server, Java client): by modifying the value of the DATE6_YEAR_LIMIT key in the CfgConfiguration.properties file.


With this predefined function, the dates set as parameters are checked. If one of them is not valid, the function is not run and the result field is reset to zero.


Syntax

Result = &DATES6_INTERVAL(Date format;Beginning date;End date)


Parameters


Description

Contents

Controls

Result

Seven-position numeric variable.

Number of days between the two specified dates set as parameters.


Date

format

Three-position alphanumeric constant or variable.

Format for the dates set as a parameters.

Possible values:

DMY  Day/Month/Year

DYM  Day/Year/Month

MDY  Month/Day/Year

MYD  Month/Year/Day

YMD  Year/Month/Day

YDM  Year/Day/Month

Mandatory parameter.

Beginning date

Six-position numeric constant or variable.

Calculation beginning date.

Mandatory parameter.

End date

Six-position numeric constant or variable.

Calculation end date.

Mandatory parameter.


Note: The beginning date must be earlier than the end date, otherwise the obtained result is negative.


Example

FORMAT = 'MDY'

ORDER_DATE = 123100

PAYMENT_DATE = 012001

NB_DAYS_DIFF = &DATES6_INTERVAL(FORMAT;ORDER_DATE;PAYMENT_DATE)

*

* NB_DAYS_DIFF is equal to: 20


NB_DAYS_DIFF = &DATES6_INTERVAL(FORMAT;PAYMENT_DATE;ORDER_DATE)

*

* NB_DAYS_DIFF is equal to: -20


List of predefined functions by topic


↑ Top of page

  • Aucune étiquette