Question: how to change sql query in excel?
Answer: Go to the Data tab on the Ribbon and select Connections. ...  Choose the connection you want to edit and then click the Properties button. The Connection Properties dialog box opens. ...  Change the Command Type property to SQL and then enter your SQL statement.