Can't return Query

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I am a new excel user and could use some help.

Using the Query Wizard I have created a "new data source" and a new Query.
When I view the query, everything I want is there but I am unable to get the
retrieved rows to back into the blank worksheet on tab 2. As best I can tell
I have followed the instructions correctly.

Once I have saved the Query and have viewed the query to be sure the
retrieved rows are correct, how do I get them into the blank worksheet on
tab #2 ?

All comments and suggestions are most welcome!
 
Hi

In Query Wizard, after you have selected fields and set selection criterias
and sort order, the Finish screen is displayed. Check 'Return Data to
Microsoft Excel' when not selected, and then Finish.
Now your active worksheet with active cell selected is displayed, along with
'Returning External Data ...' screen. When you selected the upper-left cell
for would-be query data range as active cell, before you started with query
wizard, then now simply press Enter, otherwise point to wanted location in
'Returning ...' window, or enter it there manually.

When you anyway don't get query results at selected location, then probably
you have some problem with your SQL syntax - post your SQL string here,
along with info about ODBC driver you used.
 
Arvi Laanemets said:
When you anyway don't get query results at selected location, then probably
you have some problem with your SQL syntax - post your SQL string here,
along with info about ODBC driver you used.

Thank you, the problem was indeed the driver, I now have it working.

I have another related question.

I am getting external data from sheet1 in excel and bring it back into
several sheets (2 thru 9). I have created all the queries in sheet2 to
retrieve what I need. The following sheets (3 thru 9) will all use the same
queries except for one field (which will be different for each sheet)

Rather than recreate all the queries for each sheet, is there a way to copy
the queries, changing just the one field I need for each sheet?

Many thanks for your expert advice!

Paul
 
Hi


Paul said:
Thank you, the problem was indeed the driver, I now have it working.

I have another related question.

I am getting external data from sheet1 in excel and bring it back into
several sheets (2 thru 9). I have created all the queries in sheet2 to
retrieve what I need. The following sheets (3 thru 9) will all use the same
queries except for one field (which will be different for each sheet)

I'm not sure about your setup here. You have some excel table on sheet1, and
you want to retrieve some data from sheet1 groupwise into sheets 2-9, using
Excel ODBC queries, want you?

When this is the case, then be aware, that ODBC query from Excel tables
isn't very fast. Mostly you can get same result using worksheet functions -
built-in or user-defined. Queries are paying of only, when source table is
too huge, and as result recalculating of formulas takes too much time.
Rather than recreate all the queries for each sheet, is there a way to copy
the queries, changing just the one field I need for each sheet?

When you anyway want to go along with queries, then after you get your
sheet1 working properly:
1. Copy sheet2 into same workbook (making a copy), and rename it as sheet3
2. With any cell in query's datarange selected, invoke Query Editor, and
select SQL view from menu.
3. In SQL string, change the WHERE clause of query, so that right filtering
is applied.
4. Qlose the Query Editor - the query is refreshed, and when you did all
right, you get another group of data retrieved from sheet1.
5. Repeat 1 - 4 until all sheets up to sheet9 are created.
 
Back
Top