DATERESULT
Syntax
![]()
Command
Mandatory parameter Optional parameter Mandatory keyword Optional keyword |
To assign a date to a DATERESULT format:
DATERESULT.<Format> := <Date> [RESULTOKTO <Variable>]
To assign the datevalue from DATERESULT to the specified variable:
<Variable> := DATERESULT.<Format>
Description
DATERESULT is a standard variable defined in the Global Definitions that stores a specific date. Dates can be set and read in different date formats.
Diagram
N.A.
Returned value type
Depending on the date format used
Parameters
Parameter | Description | |||
<Format> | The date formats used for setting or reading the DATERESULT variable Valid date formats are: |
|||
|
Format: | Type: | Length: | Example: |
|
CC | Numeric | 2 | 20 |
|
CCYY | Numeric | 4 | 2009 |
|
CCYY-MM-DD | Alpha | 10 | 2009-05-06 |
|
CCYY-MMM-DD | Alpha | 11 | 2009 MAY 06 |
|
CCYYDDD | Numeric | 7 | 2009126 |
|
CCYYMMDD | Numeric | 8 | 2009126 |
|
CCYYMMDDHHMMSSNNN | Numeric | 17 | 20240305143842800 |
|
CCYYMMMDD | Alpha | 9 | 2009MAY06 |
|
CENTURY | Numeric | 2 | 20 |
|
DATETIME | Alpha | 23 | 2024-03-05 14:38:42.800 |
|
DAYNUM | Signed | 6 | 039937 |
|
DD | Numeric | 2 | 06 |
|
DD-MM-CCYY | Alpha | 10 | 06-05-2009 |
|
DD-MM-YY | Alpha | 8 | 06-05-09 |
|
DD-MMM-CCYY | Alpha | 11 | 06 MAY 2009 |
|
DD-MMM-YY | Alpha | 9 | 06 MAY 09 |
|
DDMMMCCYY | Alpha | 9 | 06MAY2009 |
|
DDMMMYY | Alpha | 7 | 06MAY09 |
|
DDMMCCYY | Numeric | 8 | 06052009 |
|
DDMMYY | Numeric | 6 | 060509 |
|
HHMMSSNN | Numeric | 8 | 10464426 |
|
HHMMSSNNN | Numeric | 9 | 143842801 |
|
IN-ALPHA | Alpha | 25 | 2009 MAY 06 |
|
MM | Numeric | 2 | 05 |
|
MM-DD-CCYY | Alpha | 10 | 05-06-2009 |
|
MM-DD-YY | Alpha | 8 | 05-06-09 |
|
MMDDCCYY | Numeric | 8 | 05062009 |
|
MMDDYY | Numeric | 6 | 050609 |
|
MMM-DD-CCYY | Alpha | 11 | MAY 06 2009 |
|
MMM-DD-YY | Alpha | 9 | MAY 06 09 |
|
MMMDDCCYY | Alpha | 9 | MAY062009 |
|
MMMDDYY | Alpha | 7 | MAY0609 |
|
MONTHDAYS | Numeric | 2 | 31 |
|
TIME | Alpha | 12 | 14:38:42.800 |
|
TODAY | Alpha | 15 | WEDNESDAY |
|
UK-ALPHA | Alpha | 25 | 06 MAY 2009 |
|
US-ALPHA | Alpha | 25 | MAY 06 2009 |
|
WEEKNO | Numeric | 2 | 19 |
|
YY | Numeric | 2 | 09 |
|
YY-MM-DD | Alpha | 8 | 09-05-06 |
|
YY-MMM-DD | Alpha | 9 | 09 MAY 06 |
|
YYDDD | Numeric | 5 | 09126 |
|
YYMMDD | Numeric | 6 | 090506 |
|
YYMMMDD | Alpha | 7 | 09MAY06 |
<Date> | Value that is assigned to the date given in the specified format. | |||
<Variable> | Name of the variable that gets the datevalue of DATERESULT. | |||
It is possible to assign a value to dateresult.weekno, but resok will always be false. |
Remarks
Also other variables can be used to store dates and there is no restriction that limits the number of date variables that are used. However the name "DATERESULT" is default. As default, DATERESULT is set as a global definition.
If a variable with decimals is assigned to DATERESULT, the decimals will be ignored in the conversion.
When a valid date is assigned RESOK will be set to true, otherwise to false and in that case the date will be set to today's date.
When DATERESULT has not been previously set it will return today's date. |
The base date for use with the daynum format is determined by SI-BASE. |
Examples
dateresult.ccyymmdd := today.ccyymmdd
// Sets the data value for Dateresult to today's date
dateresult.ddmmccyy := 12102009
// Sets the data value for Dateresult to October 12th 2009
display_date1 := dateresult.ddmmmyy
// Converts the Dateresult value into '12OCT09'
// and places this value into the layout field display_date1
display_date2 := dateresult.monthdays
// Converts the Dateresult value into the number of days in the month
// October 2009, i.e. 31. This value is then placed into display_date2
// Sets the data value for Dateresult to today's date
dateresult.ddmmccyy := 12102009
// Sets the data value for Dateresult to October 12th 2009
display_date1 := dateresult.ddmmmyy
// Converts the Dateresult value into '12OCT09'
// and places this value into the layout field display_date1
display_date2 := dateresult.monthdays
// Converts the Dateresult value into the number of days in the month
// October 2009, i.e. 31. This value is then placed into display_date2