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.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 99 SQL DataFlows
- 611 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 717 Beast Mode
- 51 App Studio
- 40 Variables
- 671 Automate
- 171 Apps
- 448 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 118 Manage
- 115 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 104 Community Announcements
- 4.8K Archive