Fine-Tune Your Selection Criteria for FlexRep Outputs
Using the Record Selection buttons on the FlexRep menu, you can specify detailed selection criteria to find voters for your FlexRep output. But you might discover that, for some outputs, even that degree of specificity isn't sufficient. If you understand how to code SQL statements, you can edit the selection criteria for an even more customized result.
To enable the text editing box:
- Click Selection Text Edit on the toolbar. This allows you to enter text in the box on the lower-left portion of the dialog.
- Modify the selection criteria, as needed. See Syntax and Usage Rules for more information.
- After making your edits, you can click Run FlexRep to create the output using the edits you have made. The Count Selected Records and Print buttons are also available. Your edits are included in the report that is created by clicking Print on the toolbar.
If you want to retract your edits, click the Default Selection button on the toolbar to reset the text to its default version. This also disables the editing mode.
You can save the specification, which lets you share it with other users or use it again yourself.
- The only fields that can be used in your edits are those in the Votrm database table.
- Field names must be formatted in a particular way; they must be enclosed in braces ({}). The first reference to a field name must include the table name Votrm followed by a period (.) and then the field name. Any underscore characters in the field name must be included. For example, the field street_name would be coded like this:
{votrm.street_name}
- Dates must be entered in the format date(yyyy,mm,dd). The month and day must each be represented by two digits. For example, the date March 6, 2008 would be represented as:
date(2008,03,06)
- Boolean operators, such as AND and OR, can be used and mixed. Use parentheses when using both operators to indicate the order of evaluation (see Example 1, below).
- Numeric operators, like those in the following examples, can be used.
{Votrm.Birth_Date} > date(1945,03,02) |
greater than condition |
not {Votrm.Birth_Date} > date(1945.03.02) |
not greater than condition |
{Votrm.Birth_Date} <= date(1956,03,02) |
less than or equal to condition |
{Votrm.Birth_Date} <> date(1945,03,02) |
not equal to condition |
- Alpha literals must be enclosed in single quotes. For example:
Assistance_Required = 'Y'
- Numeric literals must not be enclosed in quotes. For example:
USPS_City = 0
- The expression used to designate when the value of a field is NULL is a special case. The syntax used depends upon the output you are trying to create:
- If your output is generated in Crystal Report format (that is, Voter List or Labels), the proper syntax for this expression is:
ISNULL
- When the intended output is an export file (that is, Text File without Voting History, Text File with Voting History, Text File Export for Commercial Printer, or Simplified Export for Commercial Printer), the proper syntax is:
IS NULL
Example 1 below shows the coding for both outputs.
Example 1: Find Active Voters Who Are Not All-Elections or FPCA Absentees
{Votrm.Status}='A' AND
({permanent_abs_req_expiry} is null OR {permanent_abs_req_expiry} <= date (2008,03,26))
{Votrm.Status}='A' |
Find Active voters |
AND |
Boolean operator |
({permanent_abs_req_expiry} is null |
Voters who have no absentee expiration date |
OR |
Boolean operator |
{permanent_abs_req_expiry} <= date (2008,03,26)) |
Voters whose absentee expiration date is earlier than today's date (March 26, 2008) |
{Votrm.Status}='A' and (isnull ({votrm.permanent_abs_req_expiry}) or {votrm.permanent_abs_req_expiry} <= date (2008,03,26))
Example 2: Find Active Voters Interested in Poll Work Who Registered a Particular Month
{Votrm.Status}='A' AND {Votrm.Registration_Date} >= date (2008,07,01) AND{Votrm.Registration_Date} <= date (2008,07,31) AND {Votrm.Pw_active} = 'I'
{Votrm.Status}='A' |
Find Active voters |
AND |
Boolean operator |
{Votrm.Registration_Date} >= date (2008,07,01) |
Voters who registered on or after July 1, 2008 |
AND |
Boolean operator |
{Votrm.Registration_Date} <= date (2008,07,31) |
Voters who registered on or before July 31, 2008 |
AND |
Boolean operator |
{Votrm.Pw_active} = 'I' |
Voters whose worker status code is I (Interested Voter) |
Example 3: Find Voters of a Party Who Were Made Ineligible after a Particular Date
{Votrm.Status}='P' AND {Votrm.Last_Date_Status_Changed} >= date (2008,01,01) AND ({Votrm.Party}='REP')
{Votrm.Status}='P' |
Find Ineligible voters |
AND |
Boolean operator |
{Votrm.Last_Date_Status_Changed} >= date (2008,01,01) |
Voters whose registration status changed on or after Jan. 1, 2008 |
AND |
Boolean operator |
({Votrm.Party}='REP') |
Voters who are Republican |
Example 4: Find Federal-Elections-Only Voters
{Votrm.Status}='A' AND {Votrm.FederalElectionsOnly} = 'Y'
{Votrm.Status}='A' |
Find Active voters |
AND |
Boolean operator |
{Votrm.FederalElectionsOnly} = 'Y' |
Voters whose FederalElectionsOnly flag is turned on |