PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
  • Overview
  • Example 1: Simple query
  • Query to create
  • How to create this query?
  • Example 2: Advanced query
  • Query to create
  • How to create this query?
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
This help page explains how to create two select queries:
  • a simple query.
  • an advanced query.
These two queries are created from the "WD Queries" project (supplied with WINDEV).
Example 1: Simple query

Query to create

Selecting the characteristics of the customers (number, name and phone) who live in Paris.

How to create this query?

The steps are as follows:
  1. Click among the quick access buttons. The element creation window appears: click "Query". The query creation wizard starts.
  2. Select "Select" and validate. The query description window appears.
  3. Enter the name and caption of the query.
  4. In the section on the left, double-click on the items "CustomerNum", "CustomerName", "City" and "Phone" of the CUSTOMER data file.
  5. In the middle section, select the "CUSTOMER.City" item.
  6. Click the "Selection conditions" button and select "New condition". The wizard for creating a selection condition is displayed.
  7. Select the selection criterion ("starts with"). Select "the value" and enter "Paris" in the "Value" control. Validate.
  8. Click the "Display/Rename" button.
  9. Answer "No" to "Display this item" and validate.
    Remark: There is no need to display the values of the "City" item in the query result: all customers selected by the query live in Paris.
  10. Validate the query description window. The graphic representation of query is automatically displayed in the query editor.
  11. Save the query ( ).
Example 2: Advanced query

Query to create

Displaying the number of orders placed by each customer living in Paris from 01/01/2014 to 01/31/2014.
The important points in the query are as follows:
  • defining a selection condition on the city of customers.
  • defining a selection condition on the date of orders.
  • counting the orders placed by each customer.

How to create this query?

The steps are as follows:
  1. Click among the quick access buttons. The element creation window appears: click "Query". The query creation wizard starts.
  2. Select "Select" and validate. The query description window appears.
  3. Enter the name and caption of the query.
  4. In the section of the left, double-click on the items "CustomerNum", CustomerName" and "City" of the CUSTOMER data file and on the "OrderDate" of the ORDER data file.
  5. In the middle section, select the "CUSTOMER.City" item.
  6. Click the "Selection conditions" button and select "New condition". The wizard for creating a selection condition is displayed.
  7. Select the selection criterion ("starts with"). Select "The value" and enter "Paris" in the "Value" control. Validate.
  8. Click the "Display/Rename" button.
  9. Answer "No" to "Display this item" and validate.
    Remark: There is no need to display the values of the "City" item in the query result: all customers selected by the query live in Paris.
  10. Click the "Count" button and select "On a new item". The window for item selection is displayed.
  11. Display the "Other items" tab, select the "OrderNum" item and validate the window ("Select" button). The description window of a count is displayed.
  12. Validate the description window of the count.
  13. In the middle section, select the "ORDERS.OrderDate" item.
  14. Click the "Between two dates" button. The description window of a condition is displayed.
  15. Enter "01/01/2014" in the first "Value" control and "31/01/2014" in the second "Value" control. Validate.
  16. Validate the query description window. The graphic representation of query is automatically displayed in the query editor.
  17. Save the query ( ).
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment