Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • Vijay_A_Verma's avatar
    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