The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have this below line of code. I have made a table with the name DateInput and it has column Date
Source = Sql.Database("-----", "---", [Query="select * FROM --- WHERE WeekEnd = 'Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0}'"]),
It's showing the error as Toek Comma Expected. While clicking on error it's highlighting DateInput
Since the item is a date type, you would need to wrap Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0} inside a Text.From
that is:
Text.From(Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0})
Try this:
Source = Sql.Database("-----", "---", [Query="select * FROM --- WHERE WeekEnd = '" & Excel.CurrentWorkbook(){[Name="DateInput"]}[Content][Date]{0} & "'"]),
After using this, it's showing below error
Expression.Error: We cannot apply operator & to types Text and DateTime.
Details:
Operator=&
Left=select * FROM ----
WHERE WeekEnd = '
Right=3/18/2023 12:00:00 AM