How to: |
Given a date-time value and time component keyword as input, DTIME returns the value of all of the time components up to and including the requested component. The remaining time components in the value are set to zero. The field to which the time component is returned must have a time format that supports the component being returned.
DTIME(datetime, component)
where:
Date-time
Is the date-time value from which to extract the time component. It can be a field name or a date-time literal. It must provide a full component date.
Keyword
Valid values are:
The following request defines two date-time fields:
DEFINE FILE VIDEOTR2 TRANSTIME/HHISsm = DTIME(TRANSDATE, MINUTE); TRANSTIME2/HHISsm = DTIME(DT(2018/01/17 05:45:22.777888), TIME); END TABLE FILE VIDEOTR2 SUM TRANSTIME TRANSTIME2 BY MOVIECODE BY TRANSDATE WHERE MOVIECODE CONTAINS 'MGM' ON TABLE SET PAGE NOLEAD ON TABLE SET STYLE * GRID=OFF,$ ENDSTYLE END
The output is shown in the following image.