Working with Queries
When your application includes tables, you can select and display data from those tables using queries. You can use queries for various tasks:
Answering a question quickly. For example, you can find out information such as:
Customer name and address associated with a particular ID number
Number of outstanding orders
Number of customers with overdue balances
Region or salesperson with the best sales record
Viewing a relevant subset of your data
Organizing and generating data for a report. You can also run reports separately without using a query.
You can create queries from tables, define and organize query results, collect user input using queries, and customize queries. You can also direct queries to different destinations so that you can use them in other parts of your application.
In This Section
How to: Create Queries (Visual FoxPro)
Describes the different methods you can use to create queries.How to: Query Multiple Tables and Views
Describes how to create queries from multiple tables.How to: Control Record Selection with Joins
Describes how to use join conditions between tables to expand or narrow results.How to: Define Query Results
Describes how you can define the data appearing in the results of a query.How to: Organize Query Results
Describes how you can organize the data results appearing in the query output.How to: Customize Queries
Describes ways to customize queries in the Query Designer, such as narrowing or expanding queries, eliminating duplicate queries, extracting percentage of top records, and adding expressions for filtering.How to: Customize Queries Using SQL SELECT Statements
Describes how to customize queries by viewing and editing the SQL SELECT statement generated for views by the View Designer.How to: Collect User Input with Queries
Describes how you can collect user input from a form to use in SQL SELECT statements for queries.How to: Run Queries (Visual FoxPro)
Describes how to run queries after they are defined.Setting Query Output Destinations
Provides procedures for sending query output to tables and arrays, reports, windows, and form controls.
Related Sections
Working with Data
Provides an overview and information about using data in your applications, for example, analyzing data requirements and designing your application components to meet those requirements.Working with Tables (Visual FoxPro)
Discusses how to structure your tables to meet your application requirements. Data type and index choices are essential to the success of your application.Working with Records
Explains how to store data in the table by adding new records and that you can change and delete existing records through the interface or by using commands.Working with Views (Visual FoxPro)
Explains how to use views to create a customized updateable data set for your application.