moving like column data to a new columns for related rows

J

JackF

I have a large data set where relataed rows contain a column called code, I
would like to create a query that would put each unique code in a new column
for each related row. Here is an example of the dataset:

PatNo. Patname ClaimNo Code
12 Smith 2131 12.1
12 Smith 2131 13.1
14 Brown 1201 9.1
14 Brown 1201 12.1
14 Brown 1201 26.2
14 Brown 1201 18.5
35 Apple 891 12.2
36 Smyth 3320

I would like the results to look like:

PatNo. Patname ClaimNo Code1 Code2 Code3 Code4
12 Smith 2131 12.1 13.1
14 Brown 1201 9.1 12.1 26.2
18.5
35 Apple 891 12.2
36 Smyth 3320

I am using Access 2007 and familar with building queries, however get stumped
every time I run into this type of issue.

Thank you,

Jack
 
J

JackF

Thanks John,

I have not used a crosstab query before and will give this a try.

Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top