Sybase 2 Barcode Reader User Manual


 
CHAPTER 9 Filtering, Sorting, and Grouping Rows
DataWindow Designer User’s Guide 267
3 (Optional) Click Verify to make sure the expression is valid.
4 Click OK.
Only rows meeting the filter criteria are displayed in the Preview view.
Filtered rows and updates
Modifications of filtered rows are applied to the database when you issue
an update request.
Removing a filter
To remove a filter:
1 Select Rows>Filter from the menu bar.
2 Delete the filter expression from the Specify Filter dialog box, then click
OK.
Examples of filters
Assume that a DataWindow object retrieves employee rows and three of the
columns are
Salary, Status, and Emp_Lname. Table 9-1shows some examples
of filters you might use.
Table 9-1: Sample filters
Setting filters in a
script
You can use the SetFilter and Filter methods in a script to dynamically modify a
filter that was set in the DataWindow painter. For information about
SetFilter
and
Filter, see the online help.
Sorting rows
You can use an ORDER BY clause in the SQL SELECT statement for the
DataWindow object to sort the data that is retrieved from the database. If you
do this, the DBMS itself does the sorting and the rows are brought into
DataWindow Designer already sorted.
To display these rows Use this filter
Employees with salaries over $50,000
Salary > 50000
Active employees Status = 'A'
Active employees with salaries over
$50,000
Salary > 50000 AND Status = 'A'
Employees whose last names begin
with H
left(Emp_Lname, 1) = 'H'