Question: how to export the data from sql server to excel using query?
Answer: This will open the SQL Server Import and Export Wizard window:
To proceed with exporting SQL Server data to an Excel file, click the Next button. ... 
From the Data source drop down box, choose the SQL Server Native Client 11.0 item.