How to get just value from database query in Excel?
Posted
by
Corin
on Super User
See other posts from Super User
or by Corin
Published on 2011-03-18T22:30:15Z
Indexed on
2011/03/19
0:12 UTC
Read the original article
Hit count: 223
excel-2007
I'm creating a spreadsheet as a collection point of information from a number of MS Access databases. I will run a query on each database to get a count of records in a particular table. Each database has the same structure but different content as they are used in different situations. So the query returns a single value, rec_count. I've figured out how to create that query, save it and then use it as the data source. So far so good.
The problem is that Excel treats the query results as a table. So instead of getting just the single value the query returns, I also get the field name. Thus the result takes up two cells instead of one.
When linking in the data source, I only see Table, PivotTable Report and PivotChart as options for viewing the data. I don't want any of those. I just want the single value without any formatting, column headers, etc. Is there a way to do this is Excel 2007?
© Super User or respective owner