Open topic with navigation

TIBCO ActiveSpaces® 4.8.0

# Querying tibDateTime Columns

To perform a SQL query on a tibDateTime column, the value of the tibDateTime column is internally converted to a string of the form:

    YYYY-MM-DD HH:MM:SS.SSSSSSSSSZ

Where the ' SSSSSSSSS ' following ' SS. ' represent nanoseconds and 'Z' represents Coordinated Universal Time (UTC).

ActiveSpaces internally converts tibDateTime column values to strings in this format. As a result, the SQL date and time functions, which normally only work on ISO 8601 formatted strings can also be used on the converted tibDateTime values. The date and time functions are lenient with respect to the number of digits following the decimal in the fractional seconds, so the nine places of precision in the string representation of a tibDateTime value does not cause any issues.

The following are examples of queries, which can be run on a column of type `datetime` that contains a tibDateTime object:

    SELECT * FROM mytable WHERE dtm=’2016-01-01 00:00:00.000000000Z’
    SELECT * FROM mytable WHERE date(dtm)=’2016-01-01’
    SELECT * FROM mytable WHERE datetime(dtm)=’2016-01-01 00:00:00’

For more information about using the SQL SELECT statement to query `tibDateTime` columns, see tibDateTime.

Copyright © 2009-2022. Cloud Software Group, Inc. All Rights Reserved.