This is an interesting one. I'm writing a Crystal XI Report for a nonprofit based on an export from their fundraising database. The export creates an MDB file, which is used as the data source for the report.
There are three tables in my data source with a field containing a semicolon-delimited list of donation solicitors. I need to combine these three fields into a single column of distinct names. The results of this command will be used for both filtering and grouping. This is the table setup and desired output:
Table 1
Doe, John; Doe, Jane; Smith, Bob
Table 2
Smith, Bob
Table 3
Doe, John; Smith, Bob
I must combine this to create:
Doe, John
Doe, Jane
Smith, Bob
Easy enough, right? However, I must do this using only a SELECT statement. Why, you ask?
- The MDB is overwritten on every run. This means adding UDFs or stored procs to the MDB aren't an option, because they would be deleted during the next export run.
- End users don't have Access installed, so even if I wrote a script for them to add an object to the MDB as a step between the export and my report, they couldn't run it.
- SQL commands in Crystal can't declare variables, so I can't write a cursor or anything where processing is done between a BEGIN and END.
- I have no control over the process that generates my data source, so I can't fix it there.
I'm not sure if this is even possible to achieve within these limitations, but they are concrete. I'm almost at a point of experimenting with saving a UDF in a separate db and running the SQL command as a cross-database query so I can leverage the function, but I don't know if Crystal's SQL command can handle a cross-db query.
Any ideas for solutions, within these limitations?