Reportizer Documentation Contents Index

Query Examples

Top Previous Next

1. Select those records from the table "payments" where value of the field "paysum" is greater than 400 and less than 2000:

SELECT * FROM payments

WHERE paysum > 400 AND paysum < 2000

2. Select those records from the fields "number" and "sum" of the table "payments" where values of the field "paysum" are greater than 400 and less than 2000 and sort this data by the field "paysum" (in descending order):

SELECT payments.number, payments.paysum

FROM payments

WHERE paysum > 400 AND paysum < 2000

ORDER BY paysum DESC

3. Select all data from all fields of the table "banks" from the database "payments" (if you are in the local database then you can also refer to other aliases (for BDE data sources)):

SELECT *

FROM ":payments:banks"

4. Select data from all fields of the table "PAYMENT", and the payment date and payment sum ranges must be specified as parameters to let the user ability to input them before report is previewed:

SELECT *

FROM PAYMENT

WHERE PAYMENTDATE > :Param1 /*ParamType=Date*/

AND PAYMENTSUM > :Param2 /*ParamType=Float*/

(such comments are placed to let the program automatically select parameter types, without needing to do this by the user; but you can use Parameters section on the Data Source page instead).