How do you build a record Selection Formula that does something like a sub query.
For instance, let's say we have an Invoice database and one of the items on the invoice is the salesperson.
In my report, I want to pull any invoice that has Bob as the salesperson. Trick is, there could be multiple salesperson on any invoice. So the data structure looks something like....
TBL_INVOICES
ID | INVOICE_DATE
0 | 1/1/2005
1 | 4/8/2005
TBL_INVOICE_SALES
ID | INVOICE_ID | SALES_PERSON
0 | 0 | Bob
1 | 0 | Susie
2 | 1 | Bob
3 | 1 | Mike
So, on the report I need to see all the sales people for invoices 0 and 1 because Bob was a part of the sale.
Obviously, I can't just say WHERE TBL_INVOICE_SALES.SALES_PERSON = 'Bob' because I won't get all the records.
The query would look something like....
SELECT * FROM TBL_INVOICES WHERE ID IN (SELECT INVOICE_ID FROM TBL_INVOICE_SALES WHERE SALES_PERSON = 'Bob')
Now how do I do that in Crystal?
(Version 9.0 or 10.0)
For instance, let's say we have an Invoice database and one of the items on the invoice is the salesperson.
In my report, I want to pull any invoice that has Bob as the salesperson. Trick is, there could be multiple salesperson on any invoice. So the data structure looks something like....
TBL_INVOICES
ID | INVOICE_DATE
0 | 1/1/2005
1 | 4/8/2005
TBL_INVOICE_SALES
ID | INVOICE_ID | SALES_PERSON
0 | 0 | Bob
1 | 0 | Susie
2 | 1 | Bob
3 | 1 | Mike
So, on the report I need to see all the sales people for invoices 0 and 1 because Bob was a part of the sale.
Obviously, I can't just say WHERE TBL_INVOICE_SALES.SALES_PERSON = 'Bob' because I won't get all the records.
The query would look something like....
SELECT * FROM TBL_INVOICES WHERE ID IN (SELECT INVOICE_ID FROM TBL_INVOICE_SALES WHERE SALES_PERSON = 'Bob')
Now how do I do that in Crystal?
(Version 9.0 or 10.0)