2 Replies Latest reply on Aug 16, 2018 1:46 AM by Okechukwu Ossai

    Change string type to date type value become null?

    Yun Feng



      The datasource is live database, when I change the date column from string to date, the value become null. And I also created a new column DATE([DATE]), but it also is null value, how to fix this?



        • 1. Re: Change string type to date type value become null?
          Ritesh Bisht

          hi Yun,



          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.


          Tableau Desktop


          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.


          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.





          Please mark the answer as CORRECT /HELPFUL if it really helped you so that it can help others as well.


          • 2. Re: Change string type to date type value become null?
            Okechukwu Ossai

            I've experienced this also. I believe the problem goes away when using an extract instead of live connection. A workaround will be to use the DATEPARSE() function. Can you give an example of the string date format?