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!

Getting duplicate rows using distinct

Status
Not open for further replies.

nondrinker

Programmer
Jan 23, 2002
53
US
Hello,
I am trying to display records related to same client ID
who has products in more than one product group in one row instead of different rows for the same clientid.

For example, instead of getting an output like

ClientID ProductGroup
1 PG1
1 PG2
1 PG3


I am trying to get an output in just one row, like:
ClientID PG1 PG2 PG3
1 yes Yes Yes


I am using a distint clause in my query, but whenever i use the ProductGroup field in my query i start getting the duplicate rows for the same clientId.
Is there any work around for this problem?
Thank you.






 
I think you want a crosstab query. Set ClientId as the Row Heading, ProductGroup as the Column Heading, and TheValue:"Yes" as the Value.

Duane
MS Access MVP
 
Take a look at thread181-511702 for a method of attacking this requirement.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top