Need Help

M

M

I would like to know how to write SQL Statement to get the result below

Name Item
Ann Item1 Item2
Ben Item3

TB1
UserID Name
1 Ann
2 Ben

TB2
ItemID UserID Item
1 1 Item1
2 1 Item2
3 2 Item3


if add 4 1 Item4
the result will become
Name Item
Ann Item1 Item2 Item4
Ben Item3


Any idea, I'm using MS Access

Thanks
 
J

John W. Vinson

I would like to know how to write SQL Statement to get the result below

Name Item
Ann Item1 Item2
Ben Item3

TB1
UserID Name
1 Ann
2 Ben

TB2
ItemID UserID Item
1 1 Item1
2 1 Item2
3 2 Item3


if add 4 1 Item4
the result will become
Name Item
Ann Item1 Item2 Item4
Ben Item3

If there's an arbitrary number of items, and you want them all concatenated in
the same field, this is rather difficult. You can do it with the help of some
VBA code; see

http://www.mvps.org/access/modules/mdl0004.htm

This code gives a comma separated list but it's simple to replace the comma
with a blank.
 

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

Similar Threads


Top