KNOWLEDGE BASE

Converting String to Date or Datetime Type Results in Null Value


Published: 21 May 2013
Last Modified Date: 20 Dec 2016

Issue

When you convert a string field in the live data connection to a date or datetime data type and drag the field to view, null values appear. 

Environment

Tableau Desktop

Resolution

Option 1:

Convert the string field to a date or datetime type in the underlying database.

Option 2:

Use an extract. For more information, see Extracting Data in Tableau Help.

Option 3:

Use custom SQL to wrap the date dimension interpreted as a string with the date() function. For more information, see Connecting to a Custom SQL Query in Tableau Help.

Cause

The date/time field from the live data source is of type string. When using a live connection, Tableau Desktop relies on the remote database to perform the conversion from string to date or datetime. Because most databases do not handle these conversions uniformly, Tableau Desktop is unable to enforce a standard behavior.
Did this article resolve the issue?