Tim
Tim

Reputation: 11

Crystal Reports XI Record Selection Issue using Multiple Criteria

A huge thanks to anyone that tries to help me in advance!

I'm not a programmer, but I have to work with Crystal Reports XI at work.

I have been asked to put together a report that will allow us to see all of the cases numbers that have the following criteria: It must have a 0 in the AE field for the previous three months.

So Jan 2015 AE=0, Dec 2014 AE=0 and Nov 2014 AE=0. In other words if a case has 0 AE for those three months it will show up. If not it won't.

I've worked on this for several days and stumped (like I said I'm not a programmer and have learned a high appreciation for the talents and skills programmers bring to the table!

What I have so far is only one of numerous attempts to get the results I'm looking for, but here is the formula I currently have in the Record Select

(which of course does not work):

{CASE.CASE_OWNER} = "TIM" and
not ({UNIT.RESP_CODE} in "20" to "74") and
{CASE.ARCHIVE} = "F" and
{MICRO_DATA.AE} = 0.00 and {MICRO_DATA.REF_YY} = "2015" and {MICRO_DATA.REF_MM} = "01" and 
{MICRO_DATA.AE} = 0.00 and {MICRO_DATA.REF_YY} = "2014" and {MICRO_DATA.REF_MM} = "12" and 
{MICRO_DATA.AE} = 0.00 and {MICRO_DATA.REF_YY} = "2014" and {MICRO_DATA.REF_MM} = "11" 

Upvotes: 1

Views: 401

Answers (1)

Siva
Siva

Reputation: 9101

your and conditions are creating problems.

    {CASE.CASE_OWNER} = "TIM" and
    not ({UNIT.RESP_CODE} in "20" to "74") and
    {CASE.ARCHIVE} = "F" and
    {MICRO_DATA.AE} = 0.00 and 
    ({MICRO_DATA.REF_YY} = "2015" and {MICRO_DATA.REF_MM} = "01") OR 
    ({MICRO_DATA.REF_YY} = "2014" and {MICRO_DATA.REF_MM} = "12") OR 
    ({MICRO_DATA.REF_YY} = "2014" and {MICRO_DATA.REF_MM} = "11")

This is one way and one more way is to don't write in record selection formula just write in you condition in formulas and pick data.

Edit..........................

and not(databasefield  in "")

Edit---------------------

if ({MICRO_DATA.REF_YY} = "2015" and {MICRO_DATA.REF_MM} = "01" and isNull(yourdatabasefield))
then true
else false

write this in supress part of the date field where you are displaying

Upvotes: 1

Related Questions