13.07.2015 Views

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. If your project is not linked to a WinDev or WebDev analysis, specify the analysis to which the querymust be linked. Go to the next wizard screen.4. Select the data file from which the data will be deleted. Go to the next wizard screen.5. Define the selection conditions. See “Selection conditions”, page 196 for more details. Go to the nextwizard screen.6. Specify (if necessary) the sequence of the selection conditions with the AND and OR conditional operators:• Conditional operator AND: the selected records will match both conditions. For example, the queryselects the customers whose name starts with the letter "A" AND who live in Paris.• Conditional operator OR: the selected records will match one of the two conditions or both conditions.For example, the query selects the customers who live in Paris OR in London.Go to the next wizard screen.7. Enter the name of the query (name of the ".WDR" file corresponding to the query). This name will beused to identify the query in your programs.8. Specify the caption of the query. This caption will be used in the project documentation.Note: A query name is automatically proposed from the caption.9. Validate the description of the query. The graphic representation of the query is automatically displayedin the query editor.Notes:• You have the ability to modify all the characteristics of a query ("Query description" from the popupmenu of the query). See “Characteristics of a query”, page 191 for more details.• To view the SQL code corresponding to this query, select "SQL code" from the popup menu of thequery. If modifications are performed in the description of the query, these modifications will be automaticallycarried over into the corresponding SQL code.• You can also create a query from one or more data files described in the data model editor: to do so,"Drag and Drop" the data files selected in the "Analysis" pane to the query editor.• The test of the created query can be run from the query editor. See the “Test of the query”, page 205for more details.2.6 Union query2.6.1 OverviewThe Union queries are used to <strong>com</strong>bine several Select queries (SELECT statement). Each Select query mustbe based on data files of identical structure.For example, select the customers whose last name starts with the letter ’A’ and the prospects who live inParis. To perform this selection, the two following queries must be <strong>com</strong>bined:• selecting the customers whose name starts with the letter ’A’. This query is based on the "Customer"file.• selecting the prospects who live in Paris. This query is based on the "Prospect" file.The "Customer" file and the "Prospect" file have the same structure in the analysis.The records <strong>com</strong>mon to the two files ("Customer" and "Prospect") can:• appear once only in the result of the query (UNION operator).• appear twice in the result of the query (UNION ALL operator).To <strong>com</strong>bine queries, you must know:• the name of the queries to <strong>com</strong>bine.• whether the <strong>com</strong>mon records must appear once or several times in the result of the query.Part 2: Query editor 175

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!