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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write selection expert query for multiple criteria in Crystal s 1

Status
Not open for further replies.

ccclsi

MIS
Jan 11, 2002
11
US
Here is the selection criteria i have :

(
({PART.QTY_IN_DEMAND} <> 0.00) and
({PART.ORDER_POLICY} <> ["D", "E"]) and
({PART.DETAIL_ONLY} = "N")
and
{PART.ENGINEERING_MSTR} = "Q"
)
OR
(
({PART.QTY_IN_DEMAND} <> 0.00) and
(({PART.PLANNING_LEADTIME} = 0.00) OR ISNULL({PART.PLANNING_LEADTIME}))
and
({PART.DETAIL_ONLY} = "N")
and
({PART.ENGINEERING_MSTR} = "Q")

I added {PART.ENGINEERING_MSTR} = "Q") just to verify everything was working for testing. What i need to accomplish is that {PART.ENGINEERING_MSTR} = Zero, all alphas, and null. How do i write this to make the above criteria return all the correct records. TIA,
 
Please explain this a little more:
What i need to accomplish is that {PART.ENGINEERING_MSTR} = Zero, all alphas, and null.
Also, note that you must reverse the order of this clause or it will never pick up nulls (nulls must always be referenced before being evaluated for specific values):

(
ISNULL({PART.PLANNING_LEADTIME}) or
{PART.PLANNING_LEADTIME} = 0
)

-LB
 
OK, thanks for the tip, appreciate it.

In addition to the existing criteria, I also want to evaluate all values from {PART.ENGINEERING_MSTR} field except numerals greater than 0. There are numerals, alpha strings and nulls in this field.

TIA!
 
(
{PART.QTY_IN_DEMAND} <> 0 and
{PART.DETAIL_ONLY} = "N" and
(
isnull({PART.ENGINEERING_MSTR}) or
not isnumeric({PART.ENGINEERING_MSTR}) or
{PART.ENGINEERING_MSTR} = "0"
) and
(
{PART.ORDER_POLICY} <> ["D", "E"] or
(
ISNULL({PART.PLANNING_LEADTIME}) or
{PART.PLANNING_LEADTIME} = 0
)
)
)

Please use the parens exactly as shown.

-LB
 
Awesome, that did the trick! Thank you, You da Man!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top