Forum Discussion
Anonymous
4 years agoNot applicable
Using a list as a parameter of an SQL query
Hello. I'm not sure how to use a list as a parameter of an SQL query. The list I have is of integers: I'm trying to use it as a "WHERE IN" parameter inside an SQL query through the advanced e...
- 4 years ago
You are just there. Just replace ProtocolosEquipe10 by following
Text.Combine(ProtocolosEquipe10,", ")
let Fonte = Sql.Database("test", "test_readonly", [Query="SELECT *#(lf)FROM TEST tst#(lf)WHERE tst.field IN (" & Text.Combine(ProtocolosEquipe10,", ") & ")"]) in Fonte
moocifer
2 years agoNew Member
How do you avoid the:
Formula.Firewall: Query 'QUERYNAME' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
.. error, that this generates ??
- pointer20022 days agoNew Member
I use SQL Server instead of Access i use the following :
= Sql.Database("server", "instance", [Query="Select * from table where userid in ('" & Text.Combine(user_id,"','") &"' ) "])
Where user_id is a datatable entered manually using "Enter Data" then transform to list => column named "user_id". Verify the string simple quotes : you have to generate a native sql sentence.