forums
Use these forums to ask questions and discuss Tableau.
How to convert a string to a date
Posted August 12th, 2008 by Richard Giambrone
I have a date formatted as the following string: "w/e 01/01/2000". How do I convert this to a date field?
Comments
Leave that dimension as a string type, but create a new calculated field based on it:
DATE(RIGHT([wedate], 10))
Got it. Thanks. I had tried that, but the default aggregation was to COUNT, so the value did not look like a date. I changed the format to a date format. Thanks.
By the way, I couldn't open the wedate.twbx attachment. Here is the error message.
Database error 0x80040154: Class not registered
Unable to connect to the Microsoft Excel file "C:\DOCUME~1\Rgiambro\LOCALS~1\Temp\34.tmp\Data\temp\date.xlsx". Check that you have access privileges for the requested file and that it is not open in another application.
Glad that worked.
Hmm, "Class not registered"... I forgot and used the Excel 2007 file type rather than an older one - I'm going to guess that have an older Excel and haven't installed the 2007 Office Compatibility Pack? I'll remember to stick with .xls in the future.
I have the Compatibility pack installed. So who knows? Not a problem. Thanks.