INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Selecting records - multiple differing items with another common item present

Selecting records - multiple differing items with another common item present

(OP)
Crystal XI
SQL 2008 db

I have a customer order table, multiple lines per order (they share the same order number, which the report is sorted by). I'm trying to figure out a way to filter the data by item number twice, I will attempt to explain it clearly.
I have a list of several items that are on some orders. I need to pull those orders only if a different item also exists on those orders.
Example:
Item numbers
111
112
113
114
115

I need to pull the orders for those item numbers only if item 'AAA' is also on each of those orders.
I can't just put all the item numbers into a formula filter or the Select Expert, as it will pull all orders with 'AAA', when I need it limited to just those orders that also have the short list of items I have.
I've looked over this site, every other Crystal resource I could find, and I'm stumped. Any help is appreciated. Thanks!

RE: Selecting records - multiple differing items with another common item present

"I will attempt to explain it clearly."

What happens in vagueness stays in vagueness!

Your example bares no resemblance to your explanation. There are absolutely no AAAs in the former!

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Selecting records - multiple differing items with another common item present

(OP)
Let me try again... say I have 4 orders, keeping in mind the list of items in my first post:
Order 1 contains items:
111
AAA
Order 2 contains items:
112
555
Order 3 contains items:
114
AAA
Order 4 contains items:
444
AAA

I only want to pull the orders that have the items in my list and the singular item 'AAA', so I only want to see orders 1 and 3.
All of these items may appear in other orders on their own, but I only want to see the ones where item 'AAA' is also in the order. So the returned data has to be a combination of this list of items, and the singular 'AAA' item only.

RE: Selecting records - multiple differing items with another common item present

Need an example of the table with representative data.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close