Date_Add or Date_Sub Trying to minus a year
Hi Guys,
I'm trying to minus a year from date field coming from Netsuite.
This is what I have but it doesn't seem to be working?
SELECT
DATE_SUB(ENDING, INTERVAL 1 YEAR) 'Last Year'
FROM ACCOUNTING_PERIODS
Any suggestions would be great.
Andrew
Best Answer
-
Oh, I see you're using the NetSuite Analytics Connector.
I'm not too familiar with what functions are available.
I did a quick Google search and found this function that might be helpful:
ADD_MONTHS( {today},-12 )
I believe you insert the column name into the brackets, or replace the example column name and brackets with the column name. You could experiment and see what works.
Let me know if you get it figured out!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'2
Answers
-
Hey Andrew,
You could try Date_add, I'm assuming you're doing this in MySQL?
SELECT
DATE_ADD(`Ending`, Interval -1 Year) as `Last Year`
FROM ACCOUNTING_PERIODS
Is there a specific error that's being thrown? That might be useful to better understand what you're seeing.
Hope this is helpful!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
Hey,
Thanks for the prompt reply, the error is ;
[NetSuite][SuiteAnalytics Connect JDBC Driver][OpenAccess SDK SQL Engine]Syntax Error in the SQL statement.[10104]
I have attached the screenshot.
Regards
Andrew
0 -
Oh, I see you're using the NetSuite Analytics Connector.
I'm not too familiar with what functions are available.
I did a quick Google search and found this function that might be helpful:
ADD_MONTHS( {today},-12 )
I believe you insert the column name into the brackets, or replace the example column name and brackets with the column name. You could experiment and see what works.
Let me know if you get it figured out!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'2 -
Thank you so much!!
2 -
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
hello :)
this could be use for calculate YOY growth?
0 -
@Ana I strongly recommend against building reporting logic into your connectors. reporting logic is something that would change regularly and should be something a little closer to the hands of the business analyst.
extract your data from your source system as cleanly as possible, then build any reporting functionality using dataflows, views or in analyzer.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"2
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
- 754 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