How to: |
Available Languages: reporting, Maintain
The HDTTM function converts a date value to a date-time value. The time portion is set to midnight.
HDTTM(date, length, output)
where:
Date
Is the date to be converted, the name of a date field that contains the value, or an expression that returns the value. It must be a full component format date. For example, it can be MDYY or YYJUL.
Integer
Is the length of the returned date-time value. Valid values are:
Date-time
Is the generated date-time value. It can be a field or the format of the output value enclosed in single quotation marks. The value must have a date-time format (data type H).
HDTTM converts the date field TRANSDATE_DATE to a date-time field:
TABLE FILE VIDEOTR2 PRINT CUSTID TRANSDATE AS 'DATE-TIME' AND COMPUTE TRANSDATE_DATE/YYMD = HDATE(TRANSDATE, 'YYMD'); DT2/HYYMDIA = HDTTM(TRANSDATE_DATE, 8, 'HYYMDIA'); WHERE DATE EQ 2000; END
The output is:
CUSTID DATE-TIME TRANSDATE_DATE DT2 ------ --------- -------------- --- 1237 2000/02/05 03:30 2000/02/05 2000/02/05 12:00AM 1118 2000/06/26 05:45 2000/06/26 2000/06/26 12:00AM
HDTTM converts the date field DT1_DATE to a date-time field:
MAINTAIN FILE DATETIME FOR 1 NEXT ID INTO STK; COMPUTE DT1_DATE/YYMD = HDATE(DT1, DT1_DATE); DT2/HYYMDIA = HDTTM(DT1_DATE, 8, DT2); TYPE "STK(1).DT1 = <STK(1).DT1"; TYPE "DT1_DATE = <DT1_DATE"; TYPE "DT2 = <DT2"; END