|Data types and display formats | Data types ||
While dates and times are typically stored in columns that have an integer or decimal data type, they must be specified in a valid form to produce the expected results.
Most date and time values are represented in columns that have an integer data type. The date+time form, which contains both date and time information in one value, is unique, and it is represented a column that has a decimal data type. Functions that operate on dates and times sample the input values in the column to make sure they are in the correct data type (integer or decimal). As long as the data type is correct, the function is performed on the input. Note that the values in the column are not checked to make sure that they are valid. If the values are not valid, the function returns an erroneous or illogical output value.
Values that contain date-related information can be specified in the following forms:
For dates to be considered valid and produce a correct result, they must appear in the format above, and the values for MM, DD, and Q must stay within the expected range. MM values range from 01-12, DD values from 01-31, and Q 1-4. If a function is expecting a date value as input and the value passed to the function is outside the valid range or supported format, the function returns an erroneous or illogical output.
Values that contain time-related information can be specified in following format:
For times to be considered valid and produce a correct result, they must appear in the syntax above, and the values for each portion of HH, MM, and SS must stay within the expected range. HH values range from 00-12, and MM and SS values range from 00-59. If a function is expecting a time value as input and that value is outside the valid range or supported syntax, the function returns an erroneous or illogical output.
Values that contain a combination of date and time information can be specified in the following form: