Format DATETIME values
In the following query, the EXTEND function
displays only the specified subfields to restrict the two DATETIME
values.
The query returns the month-to-minute range for the columns
labeled call_time and res_time and gives an indication
of the work load.
The TO_CHAR function can also format DATETIME values. See The TO_CHAR function for information about this built-in function, which can also accept DATE values or numeric values as an argument, and returns a formatted character string.
Besides the built-in time functions that these examples illustrate, HCL OneDB™ also supports the ADD_MONTHS, LAST_DAY, MDY, MONTHS_BETWEEN, NEXT_DAY, and QUARTER functions. In addition to these functions, the TRUNC and ROUND functions can return values that change the precision of DATE or DATETIME arguments. These additional time functions are described in the HCL OneDB Guide to SQL: Syntax.