View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default (Excel 2007) Query Data in Database?

The command text in a query is the SQL. You can add the sql as follows.

When you get to the last menu in the query (the one with the box FINISH)
select the VIEW or EDIT QUERY option. Then press finish

the query editor will appear. Look for the button with SQL. You can edit
the query here.

Another method if you already have aquery is to select some data in the
query. Then go to the menu Data - Import External Data and you will see the
Edit Query option enabled. Select this option and the find the SQL button.

"Abel MacAdam" wrote:

Hi all,

I want to query data in a database in Excel. And I'm not exactly (actually
exactly not) sure how to get it done.

I opened the Data part of the buttons thingy, choose 'Get external data',
and next 'From other Sources'. I filled in the required information (like
database location, and username and password combination). In the next window
I selected a table, and the end result was that I imported the complete
table. And that is not what I was aiming on.

What I wanted to accomplish was to write a query using SQL. I have the query
available. What I now have to do is find the window where I can enter the
query. Do you know?

Abel