in the Domo workbench, can't separate TransactionDate (date/time format) into 2 pieces
I have created a job in the Domo workbench with the following SQL query, but in my resulting dataset, "Transaction_Date" and "Transaction_Time" are not splitting into two columns, one with just the date (2021-09-02) and the other just the time (01:00:21.000)….I am still getting both (2021-09-02 01:00:21.000). I have also tried CONVERT with no success. Thanks in advance.
CONVERT(DATE, a.[TransactionDate]) AS Transaction_Date, CONVERT(TIME, a.[TransactionDate]) AS Transaction_Time
SELECT
a.[OrderNumber],
a.[ShipToNumber],
a.[LineNumber],
a.[TransactionType],
a.[TransactionNumber],
a.[TransactionDate],
CAST(a.[TransactionDate] AS DATE) AS Transaction_Date,
CAST(a.[TransactionDate] AS TIME) AS Transaction_Time,
a.[SequenceNumber],
a.[VendorNumber]
FROM [Marketing].[dbo].[Sales] a with (nolock)
Answers
-
dates and times are still represented as timestamps. If you really just want the text values you’ll need to convert it to a string but will lose the ability to do date operations
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Is there any other way to accomplish separating TransactionDate (date/time format) into 2 pieces in the workbench other than converting it to a string, I do need to be able to do date operations?
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive