
The date function constructs a DataEase date value from three separate numeric values. You can use constants, fields, functions or derivations to deduct the values.
If any input value is invalid (e.g., month > 12 or day > 31), DataEase calculates a future date, for example, 6,45,95 becomes 07/15/95
Decimal values are automatically truncated.
MONTH
is the number of the month (1-12),
DAY
is the day of month (1-31), and
YEAR
is the last two digits of year, or the full four digit year, depending on the type of date field.
Example 1
date(7,1,99)
Returns:07/01/99
Example 2
FIRSTDAY:=date(month(TODAY), 1, year(TODAY));
LASTDAY:=date((month(TODAY)+1), 1, year(TODAY))-1.
This portion of ascriptuses avariablenamed TODAY (which holds the current date) and two other datefunctions, month and year, to find the first and last days of the current month.
The result, if the current date is July 4th, 1995, is: FIRSTDAY = 07/01/2001 LASTDAY = 07/31/01 This routine is accurate for any date.
Note: If your system is configured for an international date format other than United States, the date value may be returned in the order DD/MM/YY or YY/MM/DD. See your Microsoft Windows documentation to find the date format that corresponds to your Windows Control Panel country setting.
Regardless of how your system is configured, the three numerical values this function requires are always input in the order MONTH, DAY, YEAR.
Home>DQL Guide>DQL Lexicon> date
The datefunctionconstructs a datevaluefrom three separate numericvalues.
Syntax
?where;
MONTHis the number of the month (1-12),
DAYis the day of month (1-31), and
YEARis the last two digits of year, or the full four digit year, depending on the type of date field.
A datevaluein the Short Date format specified in theWindows Control Panel. For example, if you specify the United States default date format in Control Panel, the datevalueis returned in the order MM/DD/YY.
Usage
If any inputvalueis invalid (e.g., month > 12 or day > 31), DataEase calculates a future date, for example, 6,45,95 becomes 07/15/95
Decimalvaluesare automatically truncated.
Example 1
date(7,1,99)
Returns:07/01/99
FIRSTDAY:=date(month(TODAY), 1, year(TODAY));
LASTDAY:=date((month(TODAY)+1), 1, year(TODAY))-1.
This portion of ascriptuses avariablenamed TODAY (which holds the current date) and two other datefunctions, month and year, to find the first and last days of the current month.
The result, if the current date is July 4th, 1995, is: FIRSTDAY = 07/01/2001 LASTDAY = 07/31/01 This routine is accurate for any date.
Note: If your system is configured for an international date format other than United States, the datevaluemay be returned in the order DD/MM/YY or YY/MM/DD. See your Microsoft Windows documentation to find the date format that corresponds to yourWindows Control Panelcountry setting.
Regardless of how your system is configured, the three numericalvaluesthisfunctionrequires are always input in the order MONTH, DAY, YEAR.
Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17
Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11
Product: . Written by Marco Marchesi 15/02/16 at 14:50:46
Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44
Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10
Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40