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?
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]
0
als315Commented:
You can use Patrick Mattews DConcat function
Look at sample DB
DBConcat.accdb
0
Derek BrownMDAuthor Commented:
Hi Als315

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

Thank you.
Derek
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Rey Obrero (Capricorn1)Commented:
@Derek,

did you try the query posted above?
0
als315Commented:
0
hnasrCommented:
Can you type a sample of few records, and list the expected output?
0
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

Derek
db1.mdb
0
hnasrCommented:
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
db1-concat-records-per-group.mdb
0

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
als315Commented:
You can do it with DConcat, which is universal for all cases
DBConcat.mdb
0
Derek BrownMDAuthor Commented:
Thank you both. Excellent resolution

Derek
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.