Crystal 8.5/CE 8 with an Oracle database
I have a parameter that asks the user to select one of the following:
Qualified Projects
Non-qualified Projects
When the user selects Qualified Projects, I want to include all qualified projects and all non-qualified that reference qualified projects (if the NQ projects don’t reference any project or they reference other NQ projects I do not want to include them)
Here are my queries, which work fine if I edit the actual SQL statement in crystal:
Non-qualified:
Qualified:
Is there a way to change the SQL based on a parameter? I couldn’t figure out how to do this with the select expert since it involves a UNION and an IN statement.
Thanks!
I have a parameter that asks the user to select one of the following:
Qualified Projects
Non-qualified Projects
When the user selects Qualified Projects, I want to include all qualified projects and all non-qualified that reference qualified projects (if the NQ projects don’t reference any project or they reference other NQ projects I do not want to include them)
Here are my queries, which work fine if I edit the actual SQL statement in crystal:
Non-qualified:
Code:
SELECT id
FROM projects
WHERE qualified = ‘NO’
Qualified:
Code:
SELECT id
FROM projects
WHERE qualified = ‘YES’
UNION
SELECT id
FROM projects
WHERE qualified = ‘NO’
AND reference_id IN
(SELECT id
FROM projects
WHERE qualified = ‘YES’)
Is there a way to change the SQL based on a parameter? I couldn’t figure out how to do this with the select expert since it involves a UNION and an IN statement.
Thanks!