Need Help to Create Query

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

Jeff Boyce

You provided an example of how you want the results output ... but no idea
where the data is coming FROM.

"How" depends on "what".

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

Jeff Boyce

Perhaps I misread your notation...

Are you saying that TB1 is a table, and TB2 is another table?

If so, it looks like you could join them on UserID in a query to get all the
items belonging to a user.

To get the concatenated list of items, consider using a report, fed by the
query. Also do a search online for a concatenation routine that Duane H.
created...

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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