PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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. Select "File .. New .. Query". The wizard for query creation starts.Click among the quick access buttons.  Click "Queries" in the wheel that is displayed. The wizard for query creation starts.The window for creating a new element is displayed: click "Query". The wizard for query creation starts.
  2. Select the "Select" option and validate. The query description window is displayed.
    Note: The floating help of this window (green and transparent help) is automatically displayed. The floating help is displayed when the mouse cursor does not move. To remove this help:
    • for the current WINDEV session: press Alt+F1 simultaneously.
    Select "Select" and validate. The description window of query is displayed.
    Note: The floating help of this window (green and transparent help) is automatically displayed. The floating help is displayed when the mouse cursor does not move. To remove this help:
    • for the current WINDEV session: press Alt+F1 simultaneously.
    • permanently: display the configuration options of query editor ("Tools .. Options .. Options of the editor") and check "Don't display the floating help".permanently: display the configuration options of query editor:
      • on the "Home" pane, in the "Environment" group, expand "Options" and select "Options of the query editor".
      • check "Don't display the floating help".
  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.
    Note: 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 description window of query. 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. Select "File .. New .. Query". The wizard for query creation starts.Click among the quick access buttons.  Click "Query" in the wheel that is displayed. The wizard for query creation starts.The window for creating a new element is displayed: click "Query". The wizard for query creation starts.
  2. Select the "Select" option and validate. The query description window is displayed.
    Note: The floating help of this window (green and transparent help) is automatically displayed. The floating help is displayed when the mouse cursor does not move. To remove this help:
    Select "Select" and validate. The query description window is displayed.
    Note: The floating help of this window (green and transparent help) is automatically displayed. The floating help is displayed when the mouse cursor does not move. To remove this help:
    • for the current WINDEV session: press Alt+F1 simultaneously.
    • permanently: display the configuration options of query editor ("Tools .. Options .. Options of the editor") and check "Don't display the floating help".permanently: display the configuration options of query editor:
      • on the "Home" pane, in the "Environment" group, expand "Options" and select "Options of the query editor".
      • check "Don't display the floating help".
  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.
    Note: 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 description window of query. 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