CURRENT_DATE() Wrongggg?

Guys, there is an erro here in the WHERE clause in canvas:

SELECT CURRENT_DATE(),CAST(start_time AS DATE) FROM "active_calls",

but when I put the where clause to COUT(*)

SELECT CURRENT_DATE(),CAST(start_time AS DATE) FROM "active_calls" WHERE CAST(start_time AS DATE) = CURRENT_DATE()

The result return 0, no table, nothing

Can you share you index mapping ?
and may be try to convert to VARCHAR before comparing

POST _sql?format=txt
{
  "query": """
SELECT CAST("@timestamp" AS DATE), CURRENT_DATE() from "my-events"
WHERE CONVERT(CAST("@timestamp" AS DATE), VARCHAR) = CONVERT(CURRENT_DATE(), VARCHAR)
"""
}

start_time is Date in UTC, same as timestamp, but this dont change the result.

I have the same result yet: empty table

What version of elasticsearch are you using ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.