|
Using Queries in Office ExpressOffice Express Visual Queries allow you to easily ask your database questions. With a couple of keystrokes and mouse clicks you can create very complex and powerful queries. Office Express uses SQL statements to interact with the underlying database. SQL statements are used in the query builder but you don't need to know SQL statements to create queries. Office Express' Visual Query Builder will handle the generation of the SQL statements and all you need to do is "check" the items you want if needed a few values for limiting the number of records in the answer. When you execute a query, Office Express' database manager will process your query and return an "answer" table. This answer table contains the records that meet the criteria of your query. Once the answer has been displayed you can then print it thus creating custom reports. Let's look at the Customer Query Page: Notice in the image above there are four fields with checkmarks and the Balance field has >100 entered into it. This query tells Office Express to locate all customers who have a balance over 100 dollars and give me their last names, phone and business phones. When you click the Execute Query button an "Answer" is returned that looks like the image below:
All it took to generate this answer was four mouse clicks and two keystrokes! For more advanced queries, click on SQL Basics. Calculating Averages and Sums of Columns At the bottom of the image above, there are two buttons, Calc Avg and Calc Sum. To use these buttons simply click in a column that contains numeric data, like the Balance column, above and click one of the two Calc buttons. Saving and Loading Your Answers Office Express allows you to save you query answers. This would be ideal if you designed period end queries for end of year or month totals. You could save these queries and use them for period-to-period comparisons in the future. Comparing Queries When viewing a query answer and you click the Done button it closes that answer. If you want to keep an answer and rerun the query after changing a few parameters use the Back button at the top left of the screen or use the Report menu option at the top of the screen to go back the the Visual Query Builder. For example: 1. select the Reports option from the main menu. 2. select Query the Customer Database... 3. the Query Customers Page will be displayed (like the image at the top of this page) 4. define the query and click the Execute Query button. 5. the Answer page will be displayed 6. to keep the Answer page, DO NOT click the Done button, instead click the Back icon in the navigation bar at the top of the Office Express window. You will be returned to the Query Customer Page 7. change the query and click the Execute Query button 8. a new Answer page will be displayed. 9. by clicking the Back and Forward icons at the top of the Office Express window, you can loop through the currently open answer pages. 10. repeat this process as much as you like. TIP: If you opened many answer pages, you can quickly select one by choosing an item in the combo box in the bottom right of the Office Express Window as shown below. Home | Table of Contents | SQL Basics | |