How to: |
The HTIME function converts the time portion of a date-time value to the number of milliseconds if the first argument is eight, or microseconds if the first argument is ten. To include microseconds, the input date-time value must be 10-bytes.
HTIME(length, value, outfield)
where:
Integer
Is the length of the input date-time value. Valid values are:
8 indicates a time value that includes one to three decimal digits (milliseconds).
10 indicates a time value that includes four to six decimal digits (microseconds).
12 indicates a time value that includes seven to nine decimal digits (nanoseconds).
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
Information Builders |