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

record selection problem

Status
Not open for further replies.

back2tek

Technical User
Jan 12, 2006
64
US
Hi all,
I am running CR9 on SQLsever. I am applying a record selection criteria to filter records that has certain values or no values
as follows:

({employee_CODE}in ['R99','R98','R03','R02'])
OR
IsNull({employee_CODE})
OR
InStr({employee_CODE}, "") = 0
)

The result I am getting is only for the employees with employee_code in ['R99','R98','R03','R02'],
the records with Null or empty strings are not reported.
Is there anything wrong w/ the filter?

Thank you all
 
When writing formulas, any test for null values must come first. Without isnull, Crystal will stop processing the formula when it hits a null value; the default assumption being that null means show nothing. I made this mistake several times while I was learning Crystal, because it's not obvious to someone who's used to other programming languages.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc is coorect satting that the test for a null value should be the first test, and I would also remove the InStr function and do as this will not be passed to the database.

Try

(IsNull({employee_CODE} Or
{employee_CODE}in ['R99','R98','R03','R02'] Or
{employee_CODE} = "")

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Madawc & Parker,

Excellent...THank you so much, worked well.


Back2tek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top