Link to home
Start Free TrialLog in
Avatar of Simon France
Simon FranceFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Using subqueries in Crystal Reports record selection

I am trying to create a report that selects all results for learners if only one of their results is for a particular class.  So, I only want the results for learners on this class but I also want the results for all their other classes.

I am trying to incorporate a subquery into my record selection criteria but it doesn't like the syntax for the IN function.

{course.parkey} = 14 and
{results.ressdate} <> DateTime (1900, 01, 01, 00, 00, 00)
and {results.stukey} in (SELECT stukey FROM results WHERE csekey=12249;)

I have tried moving the SQL statement to a SQL Expression field but it fails because it returns more than one result.

I'm using Crystal Reports XI and the database is MIcrosoft SQL Server.
ASKER CERTIFIED SOLUTION
Avatar of bdreed35
bdreed35
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Simon France

ASKER

Thanks very much for a quick and clear response.  It worked.