Create a more complex query in Microsoft Query

Microsoft Query

Show All Show All

Create a more complex query in Microsoft Query

  1. Click New Query Button image.
  2. On the Databases tab, click the database from which you want to retrieve the data, or create a new data source.

    How?

  3. Clear the Use the Query Wizard to create/edit queries check box, and then click OK.
  4. Add the tables you want.

    How?

  5. Add the fields you want to appear in the result set.

    How?

    If you want to narrow your result set to include specific records, enter the criteria to filter the records.

    How?

    If you want to create a parameter query that prompts for criteria when you run it, specify the parameters.

    How?

    You can create an inner join or outer join between your tables to change the result set.

    How?

Notes

  • When you finish retrieving the data you want, you can return the result set to Microsoft Excel. For more information, click Button image.
  • You can stop running a query that's taking a long time to retrieve data by pressing ESC.
  • If you want to wait to retrieve data until you've added all the fields to your result set, make sure that the Auto Query Button image button is not pressed in. When you're ready to run your query, click Query Now Button image.
  • If you want to prevent Query from running the query before you either save the query or return the data to Excel, click Options on the Edit menu, and then clear the Validate queries before saving or returning data check box.