Forum Discussion
Pass List Value through SQL Statement without Parameter
- Anonymous8 years ago
Hi v-frfei-msft,
I found this description which was worked for me:
https://www.excelguru.ca/blog/2016/04/28/pass-parameters-to-sql-queries/
I needed to add in a couple of other fields and do some moving around but it's working great now.
Thanks for the help.
- Anonymous7 years ago
Hi Romain_FOURNIER ,
I figured out a way around it - I created a separate Day, Month and Year filter which I then passed through my SQL statement as numbers to make the date field. I've detailed what I did in this other thread:
Thanks,
MarkJames
Let's suppose that you have a table of equities and that you want to build an SQL statement limited to some equities.
1/ In Power Query Editor, create the EquitiesList parameter as text.
2/ Concatenate all of your selected equities in one line :
To do it, in a word processor or in Excel, you may replace [CRLF] (CarriageReturn/LineFeed) by [', '] :
| FR0011167451 |
| FR0011257914 |
| FR0012034015 |
→
'FR0011167451', 'FR0011257914', 'FR0012034015'
3/ Integrate your EquitiesList parameter in your PQL code (~SQL used in PQE via Advanced Editor) :
IN (#(lf) " & EquitiesList & ")#(lf)