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.
I have a postgre database (which is cheaper than mssql server) and want to make a parameterized query. Here's my code:
let
parameters = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
pr = Table.TransformColumnTypes(parameters,{{"key", type text}, {"value", type datetime}}),
prs = Table.SelectRows(pr, each ([key] = "Begin date")),
end_date = prs{0}[value],
string = "select * from h_ar_stage gangster = '"& Text.From(end_date) &"'",
Source = PostgreSQL.Database("localhost", "kobe_bryant", [Query="select * from h_ar_stage"])
in
Source
I have to munge around with the date format for the code to actually work, but before I do that, does anyone know the story behind this?
When they say non sql, does that mean non sql server, or non ansi sql based queries. Knowing msft, I think its likely they weren't smart enough to implement their folding code off of odbc logic and are forming the sql code natively.
Also, this is so epically kludgey, is there a more official way to handle parameters in power query? In the normal data tab, they have msft query, which could be nice, and there are posts from just a couple of years ago where using ?'s work if its in the predicate, though in ssdt, I think the ?'s work everywhere. Hard to say what' the current best practice. It changes every year, presumable to keep people in employment.
Solved! Go to Solution.
I didn't see any other way. You may create a support ticket.
You could also take a look at Text.Format function.
Yes, I'm sure I can format the date to a postgre date string. My real question was on query folding and a more official parameter push down method. Do you know?
I didn't see any other way. You may create a support ticket.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |