Search code examples
sqlsnowflake-cloud-data-platformredash

On a redash dashboard, what causes "Error running query: 100035 (22007): Timestamp 'd_yesterday' is not recognized"?


On a Redash application instance backed by a Snowflake database, I've got a dashboard set up with a number of queries, each of which take a parameter of type date named startDate.

Each of my queries are coded to apply the dashboard's selected date via WHERE clauses like:

WHERE created_at >= '{{ startDate }}'

In most cases, this is working fine.

However, when on my dashboard, for the startDate parameter, I select the special value Yesterday (instead of a specific date), some (but not all) of my queries display an error instead of displaying any data: Error running query: 100035 (22007): Timestamp 'd_yesterday' is not recognized.

What does this error mean, and how can I fix it?


Solution

  • This problem occurs when on the affected queries, the parameter still has its default type of text, instead of having been changed to type date.

    The error is occurring because choosing the special date value "Yesterday" on the dashboard only works with date-type parameters -- not text-type parameters.

    Changing the parameter type to date on each of the individual queries, saving those changes, and then refreshing the dashboard, should fix the problem.