How to: |
Available Languages: reporting, Maintain
The HTIME function converts the time portion of a date-time value to the number of milliseconds if the length argument is eight, microseconds if the length argument is ten, or nanoseconds if the length argument is 12.
HTIME(length, datetime, output)
where:
Integer
Is the length of the input date-time value. Valid values are:
Date-time
Is the date-time value from which to convert the time, the name of a date-time field that contains the value, or an expression that returns the value.
Floating-point double-precision
Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be floating-point double-precision.
HTIME converts the time portion of the TRANSDATE field to the number of milliseconds:
TABLE FILE VIDEOTR2 PRINT CUSTID TRANSDATE AS 'DATE-TIME' AND COMPUTE MILLISEC/D12.2 = HTIME(8, TRANSDATE, 'D12.2'); WHERE DATE EQ 2000; END
The output is:
CUSTID DATE-TIME MILLISEC ------ --------- -------- 1237 2000/02/05 03:30 12,600,000.00 1118 2000/06/26 05:45 20,700,000.00
HTIME converts the time portion of the DT1 field to the number of milliseconds:
MAINTAIN FILE DATETIME FOR 1 NEXT ID INTO STK; COMPUTE MILLISEC/D12.2 = HTIME(8, STK.DT1, MILLISEC); TYPE "STK(1).DT1 = <STK(1).DT1"; TYPE "MILLISEC = <MILLISEC"; END