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.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 292 Workbench
- 4 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 95 SQL DataFlows
- 600 Datasets
- 2.1K Magic ETL
- 3.7K Visualize
- 2.4K Charting
- 685 Beast Mode
- 43 App Studio
- 38 Variables
- 655 Automate
- 170 Apps
- 438 APIs & Domo Developer
- 42 Workflows
- 5 DomoAI
- 32 Predict
- 12 Jupyter Workspaces
- 20 R & Python Tiles
- 383 Distribute
- 110 Domo Everywhere
- 267 Scheduled Reports
- 6 Software Integrations
- 111 Manage
- 108 Governance & Security
- 8 Domo University
- 25 Product Releases
- Community Forums
- 39 Getting Started
- 29 Community Member Introductions
- 98 Community Announcements
- Domo Community Gallery
- 4.8K Archive