ODBC PowerBI 2 commands in one query

mamiya
New Contributor II

 

Hello everyone,

I'm trying to use the ODBC DirectQuery option in PowerBI, but I keep getting an error about another command. The SQL query works while using the SQL Editor. Do I need to change the setup of my ODBC connector?



DECLARE dateFrom DATE = DATEADD(YEAR, -1, GETDATE());
SELECT dateFrom AS dateFrom;

 

mamiya_0-1714651686806.png

 

mamiya_3-1714651948145.png