KNOWLEDGE BASE

Error "invalid input syntax for type date: ""; Error while executing the query"


Published: 23 May 2013
Last Modified Date: 10 Aug 2015

Issue

When using a calculated field, the following error might occur:

Database error 0x80004005: ERROR: invalid input syntax for type date: "";
Error while executing the query


 

Environment

  • Tableau Desktop
  • PostgresSQL

Resolution

Option 1

Remove blank cells.

Option 2

Use a calculated field to convert blank cells to NULL. For example, use:
if [datetime1]="" then null else date([datetime1]) end
Instead of:
date([datetime1])

Cause

This is a database limitation where PostgresSQL cannot cast blank values as dates.
Did this article resolve the issue?