How To Sub Query in Crystal Report 10

Posted on 2006-05-31
Last Modified: 2008-11-10

I have this problem. I don't know Crystal Report very well but i need to make a query like this:

select * from People
where id in (select idpeople from Agency where cap=61100)

How can i translate this kind of query to sql ?
The "in" clause seems doesn't work with crystal report (it meens array).  


Question by:giovanelliale
    1 Comment
    LVL 28

    Accepted Solution

    You can use a custom SQL statement as your report datasource if you use the Add Command option under the datasource connection.
    You calso do this through a join in the rpeort.
    Add both the People and Agency tables to your report in the Databse Expert.
    Link the tables together on the ID field.
    Close the Database Expert.
    In the Select Expert, add criteria on the CAP field in the Agency table so that CAP = 61100.
    You can now add any fields from either table to your report and get the results you want.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now