How to: |
Available Languages: reporting
The HHMS function converts a date-time value to a time value.
HHMS(datetime, length, output)
where:
Date-time
Is the date-time value to be converted.
Numeric
Is the length of the returned time value. Valid values are:
Time
Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks.
The following example converts the date-time field TRANSDATE to a time field with time format HHIS,
DEFINE FILE VIDEOTR2 TRANSYEAR/I4 = HPART(TRANSDATE, 'YEAR', 'I4'); END TABLE FILE VIDEOTR2 PRINT CUSTID TRANSDATE AS 'DATE-TIME' AND COMPUTE TRANS_TIME/HHIS = HHMS(TRANSDATE, 8, 'HHIS'); WHERE TRANSYEAR EQ 2000; END
The output is:
CUSTID DATE-TIME TRANS_TIME ------ --------- ---------- 1118 2000/06/26 05:45 05:45:00 1237 2000/02/05 03:30 03:30:00