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
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 656 Datasets
- 115 SQL DataFlows
- 2.2K Magic ETL
- 813 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 81 App Studio
- 45 Variables
- 771 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 77 Workflows
- 23 Code Engine
- 36 AI and Machine Learning
- 19 AI Chat
- AI Playground
- AI Projects and Models
- 17 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 142 Manage
- 138 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive