How to cast as datetime in Domo workbench?
I need to add a date field to a job in workbench where the date is static, but not the current date.
I have been attempting to create a calculated transform and expected to do something similar to:
to_date('05/23/2018') or cast('2018-05-23' as datetime)
Neither of those are available functions, however, and I don't see anything like them in the list of available date/time functions.
Incidentally, I have played with changing quotes, etc, but I cannot get a calculation to validate.
There was a similar question asked and resolved by using the today() function, but I need to set to a previous date.
I can set the calculation to a simple sting (05/23/2018) easily enough, but then the schema either converts the field to a string, or nulls the cells as invalid (because that is the default setting) if I lock the data type.
Not sure what I am missing. Please help me create a date field set to static previous date. Thanks in advance
Comments
-
Anyone can help out with this request?
Thanks,
0 -
Hi Laurette,
You can use the convert function in the workbench. I just tried, CONVERT('2017-01-01',DATE) AS date and it came through as a date format (1/1/2017) in Domo.
Let me know if this helps.
Thanks,
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.1 -
Hi Laurette,
Did the above help out? Additionally, you can do the same with DATETIME as I see that is referenced in your subject.
(CONVERT('YYYY-MM-DD HH:MM(put colon here, it kept making a smiley face when I used one in this post)SS', DATETIME)
ie: CONVERT('2018-01-01 07:22:45', DATETIME)
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.1 -
I agree, those should both work, but just do not for me. I know I had it working for a one-off ingestion job a few months ago, and I seem to remember using CONVERT then. I'll keep playing with it.
0 -
Laurette,
I do not have much experience with transforms but it looks like calculation builder only has specific available functions, none which will calculate a date. Are you able to write the convert code directly in the source instead of using the calculation builder?
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
That is a good idea. I think I'm going to take the ingestion off workbench and do it through the R plugin instead. Thanks for the help!
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
- 657 Datasets
- 115 SQL DataFlows
- 2.2K Magic ETL
- 815 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 81 App Studio
- 45 Variables
- 775 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 81 Workflows
- 23 Code Engine
- 40 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 1 AI Projects and Models
- 18 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 144 Manage
- 140 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