Why are all of these dates (Due_Date, PO_Date, Print_Date, Ship_Date) returning the date - 1 day
When I run the following query in SQL Server, four date fields (Due_Date, PO_Date, Print_Date, Ship_Date) return the correct date, but when I run my query in the workbench, the resulting 4 dates are -1 day (Example: date when run in SQL Server = 2023-05-04-00.00.00.000000, the correct date, but when run in the workbench my result = 2023-05-03T19:00:00). How can I resolve?
If this is due to my "timestamp_format" code logic, how else can I achieve the same result?
SELECT
MAX(RTRIM(CONCAT(RTRIM(dl.ENBECD), RTRIM(dl.ENBESK)))) AS Item_Code,
MAX(hd.C6IGNB) AS PO_Number,
MAX(hd.C6JQNB) AS Ship_Via,
MAX(hd.C6LNTX) AS Port,
MIN(timestamp_format(substr(digits(hd.C6C3DT+19000000),2,8), ''YYYYMMDD'')) as Print_Date,
MAX(timestamp_format(substr(digits(hd.C6C4DT+19000000),2,8), ''YYYYMMDD'')) as Ship_Date,
MAX(hd.C6H1ST) AS PO_Status,
MAX(hd.C6LJTX) AS Confirmed,
MAX(hd.C6PUSS) AS Type,
MAX(dl.ENFYNB) AS Vendor_Number,
MAX(dl.ENBECD) AS Item_Number,
MAX(dl.ENBESK) AS SKU,
MAX(dl.ENPCNB) AS Sequence_Number,
MAX(dl.ENKIQT) AS Order_Quantity,
MAX(dl.ENSIPR) AS FOB_Cost,
MAX(timestamp_format(substr(digits(dl.ENCWDT+19000000),2,8), ''YYYYMMDD'')) as Due_Date,
MIN(timestamp_format(substr(digits(dl.ENINDT+19000000),2,8), ''YYYYMMDD'')) as PO_Date
FROM
cwmpdta.pohead hd
JOIN
cwmpdta.podetl dl ON C6COMP = dl.ENCOMP AND C6IGNB = dl.ENIGNB
GROUP BY
dl.ENBECD, dl.ENBESK, hd.C6IGNB, dl.ENCWDT
ORDER BY Item_Code, PO_Number, Due_Date
Best Answer
-
This is because Domo interprets all dates as UTC when they get imported. If your SQL server is configured for a timezone other than UTC you can use a date transform in your workbench job configuration to specify which timezone you're importing with.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2
Answers
-
This is because Domo interprets all dates as UTC when they get imported. If your SQL server is configured for a timezone other than UTC you can use a date transform in your workbench job configuration to specify which timezone you're importing with.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 302 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 104 SQL DataFlows
- 637 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 762 Beast Mode
- 65 App Studio
- 42 Variables
- 705 Automate
- 182 Apps
- 459 APIs & Domo Developer
- 53 Workflows
- 11 DomoAI
- 39 Predict
- 16 Jupyter Workspaces
- 23 R & Python Tiles
- 401 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 8 Software Integrations
- 133 Manage
- 130 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive