Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3881

time date function doesn't return value without sorting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 8.12.3
    • Query Engine
    • Hide

      1. Use teiid on postgres.
      2. run similar SQL like the following:
      select MONTH("birth_date") as "MONTH_birth_date",
      MONTH("birth_date") as "Month_Field",
      "birth_date"
      3. MONTH("birth_date") is not returning correct value
      (but it works if you add order by "Month_Field" in SQL)

      Show
      1. Use teiid on postgres. 2. run similar SQL like the following: select MONTH("birth_date") as "MONTH_birth_date", MONTH("birth_date") as "Month_Field", "birth_date" 3. MONTH("birth_date") is not returning correct value (but it works if you add order by "Month_Field" in SQL)

      HOUR(), MINUTE(), SECOND(), DAYOFMONTH(), DAYOFWEEK(), DAYOFYEAR(), MONTH(),
      QUARTER(), WEEK(), YEAR() are returning null unless sql is ordered by date time function.

      Not working query:

      select MONTH("birth_date") as "MONTH_birth_date",
      MONTH("birth_date") as "Month_Field",
      "birth_date"
      from "FoodmartDataSource_public"."employee"
      order by "birth_date"
      limit 200001

      Working query:

      select MONTH("birth_date") as "MONTH_birth_date",
      MONTH("birth_date") as "Month_Field",
      "birth_date"
      from "FoodmartDataSource_public"."employee"
      order by "birth_date", "Month_Field"
      limit 200001

            rhn-engineering-shawkins Steven Hawkins
            mchantibco Ivan Chan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: