Date Format change
I have a few columns which use the date format 01/Jan/2016, I need to convert these to 'Date' to use as date ranges in metrics.
I have tried using the 'replace' text card in an ETL to change the forward slashes and months to numbers. This works on some rows but not all (trying to figure out why). Then I change the data type to 'Date'. I don't have any errors but there is a lot of data missing.
Is there an easier way for me to convert these columns into date format?
Many thanks
Best Answer
-
@louiswatson you can also try using the input dataset data handling section. Click on your input in an ETL and then select data Handling, you can choose data type Date and then click the settings icon for more details.
**If this answer solved your problem be sure to like it and accept it as a solution!
0
Answers
-
@louiswatson You can use the STR_TO_DATE() function to convert those values to date like this:
STR_TO_DATE(`DateField`,'%d/%b/%Y')
The second argument of the function uses these date format specifiers to specify what format the existing field uses.
2 -
@louiswatson you can also try using the input dataset data handling section. Click on your input in an ETL and then select data Handling, you can choose data type Date and then click the settings icon for more details.
**If this answer solved your problem be sure to like it and accept it as a solution!
0 -
Sometimes figuring out the date syntax can be annoying - I usually ask chatGPT like "I have text like "12/31/23" how do I make it a date in MySQL" and it will spit out the proper syntax… most of the time.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive