Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Date Add SQL error

Hi all,

 

I'm attempting to connect to a denodo database via SQL statement and I'm running into issue using the Dateadd function.  When using the below statement "DOCPOSTINGDATE BETWEEN DATEADD(Month, -12, CURRENT_DATE) AND CURRENT_DATE" I recieve the following error:

 

DataSource.Error: ODBC: ERROR [ ] ERROR: Error in select view conditions: Field not found 'month' in view with schema

 

This SQL statement executes fine in other databases.  Is there some other syntax that power BI expects?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi all,

 

I've solved my issue by consulting the help documentation around the database type my company is using, we're using a denodo solution and they use VQL for querying language which has slightly different syntax.  In the end my query looked as below and now operates as expected:

 

DOCPOSTINGDATE >= ADDYEAR(CURRENT_DATE, -1)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi all,

 

I've solved my issue by consulting the help documentation around the database type my company is using, we're using a denodo solution and they use VQL for querying language which has slightly different syntax.  In the end my query looked as below and now operates as expected:

 

DOCPOSTINGDATE >= ADDYEAR(CURRENT_DATE, -1)

amitchandak
Super User
Super User

@Anonymous ,

dateadd seems fine, but check  -https://www.w3schools.com/sql/func_sqlserver_dateadd.asp

 

Try GETDATE() in place of CURRENT_DATE in case of SQL server

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Fowmy
Super User
Super User

@Anonymous 

The DATEADD function has the following format, you need to amend your formula accordingly

= DATEADD(DateTime[DateKey],-1,year)

check the article for more info.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.