Selection Critera Not Working

I have a report which I want to filter by selections
I have created a parameter to either show all or select multiple entries
I have then created a formula to select ALL or the selected critera
Have then added the formula to the Report selection

The ALL is working ok, but if I select a criteria I see all not selected and not the criteria selected
What have I done wrong?
Have attached PDF file, Will upload RPT file later

Gordon
tasks-with-equipment-v6.pdf
Gordon HughesDirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
What is the record selection formula?
0
Gordon HughesDirectorAuthor Commented:
Hi
Have attached the latest RPT file
The record selection formula is:-
{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
{@Task Number} = 1.00 and
{@Work Category} = 1.00 and
{TASK.PRIORITY} = {?Priority}

Gordon
Tasks-with-Equipment-V7.rpt
0
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Your {?Work Category} and {?Task Number} parameters are NOT part of your record selection logic.
That's why they don't have any impact on that logic.
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Gordon HughesDirectorAuthor Commented:
The two {?} are part of the {@} which I have to use to be able to use the "ALL" criteria
Normally works? But I have something wrong
Any other suggestions

Gordon
0
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Try to change
... if {?Work Category} = {TASK.EXPENSECLASS} ...
to
...if {TASK.EXPENSECLASS} in {?Work Category} ...
0
Gordon HughesDirectorAuthor Commented:
Hi

It still out selects the required work category and shows all the rest

Gordon
0
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Place the logic that seems to fail on the report layout.  See if it returns the value you expect (1 or zero).
In other words, isolate where the problem is.
0
Gordon HughesDirectorAuthor Commented:
Hi

If I change the select record forula to
{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
{TASK.PRIORITY} = {?Priority} and
{@Task Number} = 1.00 and
{@Work Category} = 0.00

It seems to give me the right data for a work category, but if I select ALL I get nothing

Gordon
0
mlmccCommented:
What is the formula for Work Category and Task Number

Try something like

 {TASK.INSERVTASK} = {?In Service} and
 {TASK.SITEID} = {?Site} and
 {TASK.PRIORITY} = {?Priority} and
(
   {?task} = 'ALL'
OR
 {@Task Number} = 1.00
)
AND
(
   {?WorkPriority} = 'ALL'
OR  
 {@Work Category} = 0.00
)

If that doesn't work, post the formulas

mlmcc
0
James0628Commented:
In the report that you posted, the logic in {@Task Number} and {@Work Category} is backwards.

 For example, {@Task Number} is:

if {?Task Number} ='ALL' then 1 else
if {TASK.TASKNUM} LIKE {?Task Number} then 0 else 1

 That should be:

if {?Task Number} ='ALL' then 1 else
if {TASK.TASKNUM} LIKE {?Task Number} then 1 else 0

 Plus, you don't need Like, unless you're using wildcards in the values you enter in {?Task Number}.

 James
0
Gordon HughesDirectorAuthor Commented:
Hi mimcc/James

The formula mimcc posted does not work says a string is reqired (even after I corrected the field names
The formula James posted was the original one I used

OK
I would like to be abe to select a specific Work Category from the list that is in the DB and would like to be able to selected tasks using a wildcard ie RS* instead of adding the complete task number
In both cases I have added the option to select ALL

I normally have no issues with this, but for some reason it is not working on the report

So what I have is
The parameters set up o prompt the requirement

2 formula
@Work Category = if {?Work Category} ='ALL' then 1 else
if {TASK.EXPENSECLASS} in
{?Work Category} then 0 else 1

@TaskNumber = if {?Task Number} ='ALL' then 1 else
 if {TASK.TASKNUM} LIKE {?Task Number} then 1 else 0

Then the record selection is
{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
{@Task Number} = 1.00 and
{@Work Category} = 1.00 and
{TASK.PRIORITY} = {?Priority}

When I run the report after selecting a specific work category it gives me all the other work categories and exclude the one I want to see
The same happens if I try and add part of the task number ie RS* I see all the rest except the ones stating RS*

Gordon
0
James0628Commented:
As I mentioned before, the logic in {?Work Category} is backwards.  The last part should be "then 1 else 0".

 Did you actually change {@Task Number} in the report?  The version in your last post looks OK, but is that how it looks in the report?  The formulas that you posted couldn't possibly match everything _except_ RS* when you enter RS* for the parameter.  If the Like test didn't work, you could get everything, or nothing, but getting the opposite of what you asked for means that you've still got the logic reversed somewhere.

 FWIW, you could just forget the {@Task Number} and {@Work Category} formulas and put all of the logic in the record selection formula.  That would simplify things a bit.  For example:

{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
({?Task Number} ='ALL' or {TASK.TASKNUM} LIKE {?Task Number}) and
({?Work Category} ='ALL' or {TASK.EXPENSECLASS} in {?Work Category}) and
{TASK.PRIORITY} = {?Priority}

 Using the {@Task Number} and {@Work Category} formulas should also work (once the logic is corrected), but they're not necessary.

 James
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gordon HughesDirectorAuthor Commented:
James

Well done, just the job

Gordon
0
Gordon HughesDirectorAuthor Commented:
Excellent support as normal
0
James0628Commented:
Glad I could help.

 James
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.