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

print duplicate records only

Status
Not open for further replies.

stevesd

Technical User
Dec 26, 2000
74
0
0
US
Is there a way to be sure I select the duplicate records and print them both, not just the second one?
 
Since I'm not quite sure what you mean by that, I guess not. It might help to review what I have done. I have the records sorted by the appropriae field, account number, and have formatted the details section using the previous function. So, if the previous ({Acctnumber}) = {Acctnumber} it means the record should print. the way I did that was to suppress printing on the details section, then it is false if the above rule is found to be true. The result has been that second record prints, but not the first.
 
Assuming you have no use for the records that you're suppressing, perhaps you should just eliminate them at record selection level, by selecting records where count({acctnumber}) > 1.

Using a full dataset like you're doing now, you'd have to employ a formula which justifies both the first and second prospective duplicate record.

i.e. Conditionally suppress on:
If OnFirstRecord
Then
{acctnumber} <> next({acctnumber})
Else
If OnLastRecord
Then
{acctnumber} <> previous({acctnumber})
Else
{acctnumber} <> next({acctnumber}) and
{acctnumber} <> previous({acctnumber})


Naith
 
if you want to print both records with the same account number, you also need to print when Next({Acctnumber}) = {Acctnumber}
 
Naith is close, but used a grand total.

Group on the duplicate field (account number). and put the following in your group selection formula:

Count ({AccountNo},{AccountNo}) 1 Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Sorry, should have said

Count ({AccountNo},{AccountNo}) > 1 Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top