Search these areas:
Help
Support Forums
Product Info



Introduction
DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Views
Templates
Components
Data Analysis
Members
Security
Importing
Exporting
FTP
JavaScript
Object Model
JavaScript Objects
General Scripting Objects
Data Access Objects
cmdDelete Object
cmdInsert Object
cmdSelect Object
cmdUpdate Object
Data Access Method Arguments
-Columns Argument
-DoScripts Argument
-Filter Argument
-Fields Argument
-RowId Argument
-Sort Argument
-Tablename Argument
Field Object
Fields Collection
Index Object
Indexes Collection
previous Object
record Object
Resultset Object
Table Object
Tables Collection
TextImporter Object
Settings Object
View Object
Web Object
File Access Objects
Http Client Objects
Security and Membership Objects
Document Object Model (DOM)
Error Descriptions
Object Model Extensions
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
Glossary
New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

Filter Argument
The filter argument refers to an object, object literal, or string specifying a subset of table records that will be effected by the specified operation. The filter parameter specifies column names corresponding to columns in the table schema, and values corresponding to the desired values for each respective field name.

The filter argument does not have to specify every column in the schema; behavior for omitted columns depends on which method is being called. The filter string "*" indicates that the operation should be applied to all records in the specified table. A missing filter argument always generates a runtime error. An exception is thrown if a specified column name is not found.

Filters may be specified in one of the following three ways:

1.  Using an object:
var filt = new object();
filt.FieldA = "ValueA";
filt.FieldB = "ValueB";
var rs = new Resultset("MyTable", "FieldA, FieldB", filt);
2.  Using an object literal:
var rs = new Resultset("MyTable",
 "FieldA, FieldB", {FieldA:"ValueA", FieldB:"ValueB"});
3.  The following examples demonstrate string filters in conjunction with SQL expressions. They can appear as filter arguments for table related methods in script or be entered in the Filter Preset wizard in the Properties tab of the Design View of a data table's View file.

The following Resultset uses a SQL expression to filter those records where FieldA has the value ValueA and FieldB has the value ValueB.

var rs = new Resultset("MyTable", "FieldA, FieldB", 
   "FieldA='ValueA' AND FieldB='ValueB' ");
The following example uses a SQL function to filter for those orders which were filled 10 days after they were ordered, i.e., it filters for records where the ShippedDate field is 10 or more days after the OrderedDate field.
var rs = new Resultset("MyTable", "OrderedDate, ShippedDate", 
   "datediff(day, OrderedDate, ShippedDate) > 10");
For more information on specifying string filters with SQL expressions, see Filtering Views and the SQL Expressions Reference.

Filtering on File Attachment and URL fields

When filtering on File Attachment and URL fields, note that these fields store paths to files. As a result, filters on these fields should refer to paths. For example, to filter for the file "myFile.gif" in a File Attachment field called "myAttachmentField", make reference to the path to "myFile.gif" in the filter parameter.

var filt = "myAttachmentField='/myDataTable/files/myAttachmentField/myFile.gif'";
var rs = new Resultset("myDataTable", "myAtachmentField", filt);
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us