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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select records with only a particular record

Status
Not open for further replies.

chuchuchui

Technical User
Joined
Dec 23, 2004
Messages
33
Location
US
Crystal XI, IBM Universe.

I'm trying to select client who only have a particular type of policy. Our {Policies.Coverages_ID} table contains this info and the policy type I'm trying to select is 53. What should show up is clients who only have 53 as their only policies. The client may have more than one instance of the policy type but cannot have any of the other policy types that exsist.
 
Have you written a record selection formula yet? If so please share it and what did not work about it.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Try:

Group by the client, and create 2 formulas:

//@not53
If {Policies.Coverages_ID} <> 53 then
1
else
0

Then create another of:

//@is53
If {Policies.Coverages_ID} = 53 then
1
else
0

Under Report->Selection Formulas Group place:

sum(@not53),{table.client) = 0
and
sum(@is53),{table.client) > 0

Better still you'd create SQL in a command object to do this using a NOT IN or a subquery or some such...

-k
 
Thanks, that worked like a charm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top