Hi,
I am fairly new to Crystal Reports so please forgive Newb question. I am using Crystal Reports 2011.
I am building a report that pulls data from two tables. For the benefit of explaining what I am trying to do, I will use the following two tables as an example:
Table 1
SySID | CustName |
---|---|
1 | Steve |
2 | Bob |
3 | Brian |
4 | John |
5 | Lisa |
Table 2
SySID | CustTown | CustType |
---|---|---|
2 | Sydney | Busi |
3 | Melbourne | Resi |
5 | Sydney | Busi |
In the report I am displaying all records from table 1 and if the record has data in table 2, I am displaying that too. As a result I am linking the two tables with a LEFT OUTER JOIN on SySID.
When I run the report I get the following data (which is what I was expecting).
SySID | CustName | CustTown | CustType |
---|---|---|---|
1 | Steve | ||
2 | Bob | Sydney | Busi |
3 | Brian | Melbourne | Resi |
4 | John | ||
5 | Lisa | Sydney | Busi |
However, I would also like to apply a SELECT to only return customers with a CustType of Busi when the customer has data in Table 2, so I applied a SELECT statement WHERE CustType = Busi. When I previewed the report it only returns the following:
SySID | CustName | CustTown | CustType |
---|---|---|---|
2 | Bob | Sydney | Busi |
5 | Lisa | Sydney | Busi |
I thought that the reason why it was no longer returning IDs 1 and 4 is because they don't have Busi in the CustType. So I changed the SELECT statement to WHERE NOT CustType = Resi. When I previewed the report I still only got the two items 2 & 5.
Is there any way that I can apply a SELECT filter to a report in the above example so that it returns items 1, 2, 4 & 5?
Thanks in advance
Simon