I need logic for this one?

Hi All,
I have a report requirement like this

Where Dept Number equals:

  1. A7201 or
  2. A7403 and (Customer ID NOT equal RPF83 and Not equal WG683 and not equal to AP030) or
  3. D7301 or
  4. M1001 or
  5. M4001 or
  6. M4002 or
  7. M4003 or
  8. M5001 or
  9. M5002 or
  10. M7301 or
  11. M6001 or
  12. M6002 or
  13. M6003

I can implement easily with out 2 point like this: Where A.deptNo in (“1”,“3”,“4”,“5”,…).

But how can i include 2 clause in my where condition?

Note: I am using Crystal Reports 2008 Version

Thanks in advance.


MightyBO :us: (BOB member since 2007-06-28)

What about this:

select *…blah blah blah
from table
where dept_number = A7201, D7301, M1001, M4001, etc…
and
(select * from table where dept_number = A7403 and cust_id not equal RPF83, WG683, AP030)

Hopefully you follow my logic there.

Do your first select statement selecting the departments where you don’t care about the customer ID, then in your where clause add a nested query inside of that selecting the dept number where you have the restrictions.

Let me know if that makes sense…that may not be the best advice, but I do believe i t would work.


themightydude :us: (BOB member since 2008-06-05)