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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Sap Hana - Power Query DateDiff

Hello,

 

While writing BI SQL in Sap Han with Power Query, I get an error while running DateDiff.

 


where saphanadb.zpf_t_006.WEEK =DATEDIFF(DAY, CAST( saphanadb.zpf_t_051.BEGDA AS DATE ),CAST( GETDATE() AS DATE ))
order by saphanadb.zpf_t_006.CRDAT desc

 

ODBC: ERROR [S1000] [SAP AG][LIBODBCHDB DLL][HDBODBC] General error;260 invalid column name: DAY

2 REPLIES 2
Anonymous
Not applicable

Thanks you for help.

I opened a ticket to the SAP team and am waiting for a response for solution

 

 

Anonymous
Not applicable

Hi @Anonymous 

 

This error message indicates the SAP SQL statement is not correct. Maybe you can try DAYS_BETWEEN Function (Datetime) | SAP Help Portal

 

In addition, I found the following threads from SAP Community. Hope they would be helpful. Otherwise you can also seek help from the SAP Community. Its members probably have more experience in this problem. 

Solved: Over due days calculating based on sales invoice - SAP Community

How to find number of days between two given dates - SAP Community

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors