Display multiple rows into one row query result

kevinv

Registered User.
Local time
Today, 12:47
Joined
Mar 31, 2009
Messages
11
I have a result for a query made from four different tables for which I would like to refine the result of this query grouping multiple rows into columns.

Attached is a pdf file showing the results being obtained by my query and underneath is how the result would like it be after running the query.

I am currently using Access 2010.

Any help please?

Thanks

Kevin
 

Attachments

Last edited:
regret no pdf attachment - think you have to do a minimum of 10 posts before you can attach
 
the original pdf files was over than 100kb limit size. A new upload has been added to my thread. thanks
 
it's named QRY.pdf. it's just under my name of my original post!
 
Sorry - found it now

What you need is a crosstab query which will be something like this - you might need to change names to suit your actual field names

Code:
TRANSFORM Sum(Table2.Percentage) AS SumOfPercentage
SELECT Table2.SLSalesManName, Table2.Description
FROM Table2
GROUP BY Table2.SLSalesManName, Table2.Description
PIVOT Table2.PriceLevels [COLOR=red]In ("WH","RET","CONS","WH/LESS")[/COLOR];

Note the bit in red - this is required so you can display in a form, insert into a table etc. The limit is 20 fields
 

Users who are viewing this thread

Back
Top Bottom