Derek Brown
asked on
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
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
ASKER
Hi Als315
Could you please send sample db as MDB file I am still on 2002.
Thank you.
Derek
Could you please send sample db as MDB file I am still on 2002.
Thank you.
Derek
@Derek,
did you try the query posted above?
did you try the query posted above?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you type a sample of few records, and list the expected output?
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can do it with DConcat, which is universal for all cases
DBConcat.mdb
DBConcat.mdb
ASKER
Thank you both. Excellent resolution
Derek
Derek
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]