Query Problem

I have a query that has 10 columns with 10 rows/records. 9 of the columns have the same data in each record, one column has item numbers which are all different. What I want is one row showing a quantity of 10, (one for each record) and all of the item numbers from the 10 records concatenated into a new column or Note field.

There are good reasons for doing this. So I won't bother you with them. Suffice to say that there could be 100 records with only 2 or 3 variations but 100 item numbers.

A simpler way to look at it (I guess) is one column of 10 item numbers concatenated into one record In the query, if that is possible
Derek BrownMDAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
try something like this

select itemnumber, [col1] & "-"  & [col2]  & "-"  & [col3] & "-"  & [col4]  & "-"  & [col5] & "-"  & [col6] & "-"  & [col7] & "-"  & [col8] & "-"  & [col9] As NewCol, count([itemnumber]) as Qty
from tableName
group By [itemnumber], [col1] & "-"  & [col2]  & "-"  & [col3] & "-"  & [col4]  & "-"  & [col5] & "-"  & [col6] & "-"  & [col7] & "-"  & [col8] & "-"  & [col9]
You can use Patrick Mattews DConcat function
Look at sample DB
Derek BrownMDAuthor Commented:
Hi Als315

Could you please send sample db as MDB file I am still on 2002.

Thank you.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Rey Obrero (Capricorn1)Commented:

did you try the query posted above?
Hamed NasrRetired IT ProfessionalCommented:
Can you type a sample of few records, and list the expected output?
Derek BrownMDAuthor Commented:
Hi Ray Als315

It's not the columns that I want to concatenate it is the rows of one column into one field. Will your code do that?

Please see attached MDB. Ignore SetsConcatenated Table, that was created just to demonstrate Query 2. Query1 is what I am working with but I want the result to look like query2

Hamed NasrRetired IT ProfessionalCommented:
Is this helpful?
Using a module to loop through a group of records for each Batch, and concatenate DoorNumber values.

Try this by running query: concat_records_per_group

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You can do it with DConcat, which is universal for all cases
Derek BrownMDAuthor Commented:
Thank you both. Excellent resolution

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.