I am learning how to do SQL queries (from a book I haven't installed the database yet) and am wondering once you get the results of your query, can you export to Excel?
Four answers:
2006-10-06 11:03:23 UTC
You can embed a SQL query in your excel spreadsheet using MS-Query (an optional utility included with MS Office) and an existing ODBC connection to your database.
In Excel:
Data \ Import External Data \ New Database Query
From there, a wizard will appear to walk you through the process of selecting an ODBC connection, and database. You can prepare your query using the MS Query GUI, or you can type it in with SQL. You can setup Excel to retrieve parameters for your query at runtime from the worksheet so the user doesn't have to hard-code the SQL in MS Query everytime they want to change parameters.
Email or IM me if you need help with this.
OccumsRevelation
2006-10-08 18:28:14 UTC
Yes, you can export to Excel. Depending on your database tool, there is almost always an option to export the results of your query. Select a comma-delimited format and save the file with the extension, ".csv". Then open it in Excel. Excel automatically supports the comma-delimited .csv file format.
There are lots of other ways to pull data into Excel. If you have a specific example, I can answer more specifically to your system.
waqar
2006-10-04 19:10:24 UTC
If you mean the results of a query then Yes! and No! in MSSQL you can do it as well as access, for mySQL you need to use the front ends like phpMyAdmin or any third part front end and export the result as csv file. But you will need to know what tools you are using and what database you will use.
howsureyouare
2006-10-04 18:47:02 UTC
what is your database, does your database support converting query results to csv(comma seperated values), other wise use some script to write down all values, records as lines and fields seperated by commas and save it as a .csv file. open from excel.
2) Ms office has a database connector you may it to connect to your data base and drag and drop values to excel or simply save in the required format
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.