Apparently your query is returning multiple rows for each claim number and you
want to put that data into a table with a field structure that is like
Claim Number, ProcedureCode1, ProcedureCode2, ProcedureCode3, ProcedureCode4,
..., ProcedureCode[MaxNumberOfCodes]
That is a bad design for a table. Can you explain why you need to do this?
There may be a better way to solve your need.
I can't think of an easy way to do exactly what you asked for. You would need
some complex ranking queries or perhaps a crosstab query if you wanted to
solve this with SQL. You could also solve this with a VBA procedure.
It would help a bit if you could type out a line that shows the desired
result. Something like the following where the first column is the claim
number and the following columns are the procedure codes.
a123 C20 A40 R22 T11
B567 X12 R22 G40 M8b
If this is for a report, you might be happy with a list of all the procedure
codes in one column and the codes separated by a space or colon or semi-colon
or other separator.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County