KNOWLEDGE BASE

Invalid Timestamp Error When Change Data Type From String To Date and Time With Google BigQuery


Published: 15 Sep 2022
Last Modified Date: 15 Sep 2022

Issue

Invalid Timestamp error occurs when changing the data type from string to date and time in Tableau Desktop with Google BigQuery data. 

Environment

  • Tableau Desktop 2021.3.0
  • Windows 10
  • Google BigQuery

Resolution

Add the string to meet TIMESTAMP type.

For example, if the date/time data is in hh:mm:ss format, add dummy yyyy-mm-dd by calculation field as below.
  • DATETIME( '2030-12-31 ' + [<String Data Field>])

Cause

When date and time is selected in Tableau Desktop, query is sent to convert as TIMESTAMP (yyyy-mm-dd hh:mm:ss) type in BigQuery.
If data does not have enough information to convert, error message returned.

For example, "09:12:00" is missing yyyy-mm-dd info to convert to TIMESTAMP.
Did this article resolve the issue?