How to: |
Available Languages: reporting, Maintain
The HDATE function converts the date portion of a date-time value to the date format YYMD. You can then convert the result to other date formats.
HDATE(value, {'YYMD'|outfield})
where:
Date-time
Is the date-time value to be converted, the name of a date-time field that contains the value, or an expression that returns the value.
Date
Is the output format. The value must be YYMD. YYMD is a constant value and can not be changed in this syntax, although you can change the format in subsequent DEFINEs or COMPUTEs.
YYMD
Is the field that contains the result. This form of the output parameter is required for Maintain.
HDATE converts the date portion of the TRANSDATE field to the date format YYMD:
TABLE FILE VIDEOTR2
PRINT CUSTID TRANSDATE AS 'DATE-TIME' AND COMPUTE
TRANSDATE_DATE/YYMD = HDATE(TRANSDATE, 'YYMD');
WHERE DATE EQ 2000;
END
The output is:
CUSTID DATE-TIME TRANSDATE_DATE ------ --------- -------------- 1237 2000/02/05 03:30 2000/02/05 1118 2000/06/26 05:45 2000/06/26
HDATE converts the date portion of DT1 to date format YYMD:
MAINTAIN FILE DATETIME
FOR 1 NEXT ID INTO STK;
COMPUTE
DT1_DATE/YYMD = HDATE(STK.DT1, DT1_DATE);
TYPE "STK(1).DT1 = <STK(1).DT1";
TYPE "DT1_DATE = <DT1_DATE";
END
The output is:
STK(1).DT1 = 2000/1/1 02:57:25
DT1_DATE = 2000/01/01
WebFOCUS |