Open topic with navigation

TIBCO ActiveSpaces® - Enterprise Edition 5.0.0

# WHERE Clause Examples

Using the date() function always returns a date of the form:

- YYYY-MM-DD

Where:

YYYY [0000-9999]

MM [01-12]

DD [01-31]

Given a table with the following columns and values for 2016-12-24 00:00:00:

Columns | Data Type | Values
--- | --- | ---
`dtm` | `datetime` | [1482566400, 0]
`dtmstr` | `string` | “2016-12-24T00:00:00”
`dtmlong` | `long` | 1482566400
`julianday` | `double` | 2457746.50000

Assuming all columns of a row are loaded with a date or time value that contains the date 2016-01-01, the following are the examples of using the Date() function in a WHERE clause:

    SELECT * FROM mytable WHERE date(dtm)='2016-12-24'
    SELECT * FROM mytable WHERE date(dtmstr)='2016-12-24'
    SELECT * FROM mytable WHERE date(dtmlong,'unixepoch')='2016-12-24'
    SELECT * FROM mytable WHERE date(julianday)='2016-12-24'

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO ActiveSpaces® - Enterprise Edition

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