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

Filter a record

Status
Not open for further replies.

keend

MIS
Mar 13, 2017
3
US
Challenge with applying a simple filter. I have a report that I want filter out all records where a field contains the letter "L
 
One way - In your Selection Criteria, add:

instr(ucase({yourField}),"L") = 0
 
The first two lines are:
instr(ucase({job.CCMasterID}),"L")=0 and
{job.CCMasterID} in {?BegJob} to {?EndJob} and

The report is still bringing in those with an L


 
You said you wanted to filter out records with an "L", not include them. Change instr(ucase({job.CCMasterID}),"L")=0 to instr(ucase({job.CCMasterID}),"L<>0
 
AndyMc's code is correct.

You say "... the first two lines are". Please post the complete Record Selection Formula - is there an OR in it somewhere?

Pete
 
Kray--did not help
Pete/Andy--here is the code. This code is in an existing report, I just want to not include and records if the MasterID fields contains an L

instr(ucase({job.CCMasterID}),"L")=0 and
{job.CCMasterID} in {?BegJob} to {?EndJob} and
{jobcost.JCChargeClass} = 9 and
(({job.ccdatesetup} <= {?AsOfDate} and cstr({jobstatus.ccopenjob})="true" and
{jobcost.jcstartdate}<={?AsOfDate} and cstr({jobstatus.jcchargesok})="true")
or
(cstr({jobstatus.ccopenjob})="false" and {jobpart.ccinvoicedate}>{?AsOfDate} and
{job.ccdatesetup} <= {?AsOfDate} and {jobcost.jcstartdate}<={?AsOfDate} and
cstr({jobstatus.jcchargesok})="true"))
and
{jobcost.posted} =true
 
As I suspected, it will be the OR that is causing your problem. I am assuming that it is just the first line that you are adding, so would simply 'bracket' the existing code, like this:

Code:
instr(ucase({job.CCMasterID}),"L")=0 and
(
    {job.CCMasterID} in {?BegJob} to {?EndJob} and
    {jobcost.JCChargeClass} = 9 and
    (
        (   
            {job.ccdatesetup} <= {?AsOfDate} and cstr({jobstatus.ccopenjob})="true" and
            {jobcost.jcstartdate}<={?AsOfDate} and cstr({jobstatus.jcchargesok})="true"
        )
        or
        (
            cstr({jobstatus.ccopenjob})="false" and {jobpart.ccinvoicedate}>{?AsOfDate} and
            {job.ccdatesetup} <= {?AsOfDate} and {jobcost.jcstartdate}<={?AsOfDate} and
            cstr({jobstatus.jcchargesok})="true"
        )
    )   and {jobcost.posted} =true
)

Hope this helps.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top