Add Data that has been modified in the last 7 days
I have a snowflake dataset that has a modified date column. I want to merge the data that has been modified in the last 7 days to the dataset. Sometimes an order is modified after its placed and we want to capture the new values of the order.
I have used this query but its not working
SELECT * FROM "TABLE" WHERE "ORDER_MODIFIED_TIME" > SUBDATE(CURDATE(), interval 7 day)
Any help would be appreciated
Comments
-
At first glance, that seems like it should work. What is the data type for
ORDER_MODIFIED_TIME
?I think you need to use the back tick ` instead of a double quote " as well.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
ORDER_MODIFIED_TIME is in a date time format (yyyy-mm-dd hh:mm:ss) .
I will try using the back tick too.
0 -
Is the problem that you're getting an error, or is the where clause not working as expected?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
0 -
I have run it with a few different variations of this query so I have gotten a few errors.
- CURDATE is not a valid function
- Unexpected value of '7', meaning the 7 day interval
- Invalid identifier with 'interval'
- Unexpected with 'day'
I have tried variations with a BETWEEN function, ADDDATE, SUBDATE and GETDATE
0 -
Are you running this query outside of Domo, or are you using it somewhere in Magic ETL?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
0 -
This is as I am pulling the data from snowflake to Domo. In the dataset configuration within Domo
0 -
Snowflake has a bit different syntax. Try something like:
SELECT * FROM "TABLE" WHERE "ORDER_MODIFIED_TIME" > CURENT_DATE() - interval '7 day'
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
That seems to have worked! Thank you!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive