-----Original Message-----
Hi Persh,
It looks like you want to group by the Part, Name1, and
Name2, then concatenate any matches for Name2 and Name4.
If Name2 and Name4 can only consist of the two choices
listed, you could use a group by query (click the totals
button on the toolbar), group by the three fields
mentioned, and use iif(), min() and max() functions to
calculate the concatenated string. This would look
something like (air code)
iif(min([Name2])=max([Name2],min([Name2]),min([Name2]
& ", " & max([Name2])
This may give problems with Null values though, so you
may need to substitute Nz([Name2]) for each [Name2] above.
If, however, Name2 and Name4 could consist of more than
just the two choices, you will probably need to write a
custom function, which is fairly easy. There was a post
in this group this morning (7:05) titled vertical
concatenation by Di that addressed how to do this. You
would just need to modify the code slightly to get the
grouping that you want.
Hope this helps. Post back with more info if you have
any other questions.
-Ted Allen
-----Original Message-----
I need to know how i can get a result similar to this
using queries or some VB code.
Table 1:
---------
Part Name1 Name2 Name3 Name4
1 A1 AWD .5 Extended
1 A1 BWD .5 Regular
1 A1 AWD .75 Extended
2 A2 BWD .5 Extended
2 A2 AWD .5 Extended
To be displayed as:
Part Name1 Name2 Name3 Name4
1 A1 AWD BWD .5 Extended Regular
1 A1 AWD .75 Extended
2 A2 AWD BWD .5 Extended
Thanks,
Persh
.
.