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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RobertSlattery
Resolver III
Resolver III

Native query on OLEDB source with parameteres doesn't work

I have a native query with a parameterised where caluse like this...

WHERE CALDATE > @datefrom AND CLDATE < @dateto

I try to query it 

let
    Source = OleDb.DataSource("provider=IBMDASQL.DataSource.1;data source=serverconnection),
    Database = Source{[Name="SERVER",Kind="Database"]}[Data],
    calendar = Value.NativeQuery(Database,Query1, [datefrom="20230701",dateto="20240701"])
in
    calendar

This results in a datasource error, Column or global variable @DATEFROM not found.

I guess the parameters are not being picked up by Value.NativeQuery.

If I remove the parameters from the where clause, or replace with literal values, it runs fine.

Is this not supported for OLEDB?

1 REPLY 1

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors