SQL query in excel returning one value uses two rows or columns?
I'm running a query from excel to sql server that retu开发者_如何学Pythonrns a single value. It seems as if this uses two cells in excel. Is this correct? Is there a way to prevent this? Is there a way to predict whether excel will use an extra row or an extra column (I've seen both happening)?
If, in excel, I use "import external data -> new database query", and then do a count() on an sql server table, excel usually puts the result in the cell underneath the cell which I had selected when starting to do the new query (not adding an extra row, but putting the value there). Sometimes, it will instead insert an extra column before the column of the cell I had selected and put the result in the new column in the same row as the cell I had selected.
Is there a way to have excel return the value in the same cell as the one selected when starting the query? If not, is there a way to predict which of the two scenarios above will happen?
Thanks,
Ernst
I finally found the answer:
uncheck preserve column sort/filter/layout
精彩评论