Formula Fireweall references other queries error

Hi
I’m trying to pass a date from an excel table into power query to then use in a SQL query

If I hard code the AgeDatePrv the queries runs without issue. If I add the parameter in I get teh Formula.Firewall message

I’ve tried adding the parameter directly into this query but still get the same result.
I’ve tried removing the privacy settings

When it asks about running a native query - the query string appears to be correct in that it is picking up the date variable SourceDateInputsPrv correctly

Any ideas on how to fix?

Here’s what I have:
SourceDateInputsPrv = Text.From(PrvWkAgingDate),

Source = Sql.Database(“ip address”, “DB Name”, [Query=“DECLARE @AgeDatePrv as Date Set @AgeDatePrv = ’ " & SourceDateInputsPrv & " ’
SELECT *
FROM Working_Capital_Archive
WHERE QUERY_DATE = @AgeDatePrv”])