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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Passing numeric parameter in Oracle custom SQL

Hi,

 

I want to pass a numeric parameter into my custom SQL like below

 

Select .....

where.....

and FRS.SNAPSHOT_DATE_KEY > "&_SnapshotDateParam_&"

....

 

I have the parameter _SnapshotDateParam_ set as 20190501

 

However I suspect it is trying to pass the SQL through as

Select .....

where.....

and FRS.SNAPSHOT_DATE_KEY> &20190501&

....

 

Due to the following error I get:

Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&
Left=select.......

.....

Right=20190705

 

I have tried several different permeations to get this working, to no avail!

Please help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Current you can only merge t-sql string with text value. For your requirement, it means you need to add some t-sql convert type functions to convert these text type parameters.

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

It seems like power query not allow you direct merge numeric value and text value, you can add Text.From function to force convert parameter value fix this.

 

let
   Source= Sql.Database("testDB", "test", [Query="Select * from Calendar where Datekey >"&Text.From(DatekeyPara)])
in 
   Source

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @Anonymous 

 

Both are numeric though? 

It appeears that the paramter is somehow being transformed into text

Anonymous
Not applicable

Hi @Anonymous ,

Current you can only merge t-sql string with text value. For your requirement, it means you need to add some t-sql convert type functions to convert these text type parameters.

Regards,

Xiaoxin Sheng

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.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.