Wednesday, March 7, 2012

Dont know how to stop the duplication

Hi, Im still quite new to Crystal, and cant quite get my head around this one.. I'm using CR9

Ive attached a sample report to help demonstrate the problem.

I have three tables using the following fields:

Customers Tbl: DOB, Address 1, Address 2, Address 3, City + Postcode.

Folder Items Tbl: Voucher No, Tvl Date, Code, Client Name, Client Paid, Redeem Date.

Credit Card Tbl: Card Type, Card No.

Im trying to establish how many vouchers this client has ordered. On the example shown hes actually ordered 3 vouchers, but because he has two different credit cards listed in his profile, each item is duplicated, so it looks like hes made 6 orders.

If the card type equals DC, then we need to show what the card number is. If its any other card type, then we just show the two letter card code, and no other info. Which works fine when theres only one card in the profile.

I need to somehow say if there are two cards present only show the first one, and always select card type DC if there are two or more different types

Does anyone have any ideas? At the moment, I'm exporting the data into excell so I can delete the duplicates before submitting them, but the reports is getting bigger each week, and it's going to get out of hand very soon.

Thanks
LisaIn your Crystal query, use Distinct Keyword

Select Distinct columns from yourTable

No comments:

Post a Comment