Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run a 2nd query based on results of first 1

Status
Not open for further replies.

scottaherbst

Technical User
Jan 18, 2007
46
US
Out clients can get a lot of different services at the same time. The only place to go to find out which ones they are getting is in a table "service_records" which lists all the services ever delivered. I want to know which clients are getting one particular type of service - x. Easy enough. I just query to find all of the instances of x service.

Here's my problem. I then want to go back to the data that report generates, take the client id number, and find out all of the services (x, y, and z) those clients are getting. Any idea how to use the results of one query to serve as the basis for the next?

Thanks,
Scott
 
You could use a Command Object and paste in SQL, as in:

select id,fld from table1
where id in
(select id from table1 where fld ='X')

Dpeends on your Crystal version and the database being used, please post the basics in the future.

-k
 
Sorry - crystal reports 10. SQL database is on a server. Thanks, I'll give that a try.
Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top