Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection Criteria Formula

Status
Not open for further replies.

Lucieann

Technical User
Aug 29, 2003
35
US
I am trying to select specific records from an Access database using an ODBC connection. Here is the formula I am using:

{@ComingDue} = 1 and
(
if {?Officer} <> "All Officers" then
{Exception_Table.Officer} = {?Officer}
else if {?Officer} = "All Officers" then
True
) and
{Exception_Table.Category} in [21, 24, 27, 30, 32, 33, 36, 39, 42, 45, 60, 63, 66, 710, 75, 99]

@ComingDue checks a dateDiff and returns a value of 1 or 0.
{Exception_Table.Officer} is a 3 character alpha value in the Access table. An All Officers option was added to the selection values in Crystal.
{Exception_Table.Category} is a numeric value from 1 to 3 digits in length.

What I would like to do is change this formula to where users can select a specific category or an "All Category" option. I know how to handle the specific category. What I don't know how to do is make the "All Category" option only pull the category codes listed above.

Is this possible?
 
Try:

and
(
if {?Category} <> "All Categories" then
{Exception_Table.Category} = {?Category} else
if {?Category} = "All Categories" then
{Exception_Table.Category} in [21, 24, 27, 30, 32, 33, 36, 39, 42, 45, 60, 63, 66, 710, 75, 99]
)

-LB


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top