String multiple records together to insert into an IN Statement

StryderLlama

Registered User.
Local time
Today, 00:49
Joined
Oct 26, 2007
Messages
19
I need a way to take multiple records from one field in a query I have.

Example:
Group Number
123456
233456
745699

I want to take these three records (records change from day to day, may be three records may be dozens of records) and concatenate them to look like this into one record:
123456,233456,745699,

This will be used to insert into an InStr that will allow me to pull multiple group reports

I thought this has probably been addressed on this forum but I can't find what I am looking for, any help would be greatly appreciated.
 
I wouldn't save the data that way, but for display you can do this:

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

But it sounds like you may just want to do this:

SELECT Blah
FROM SomeOtherTable
WHERE GroupNumber IN(SELECT GroupNumber FROM ThisTable)

Perhaps a more complete description of what you're trying to accomplish will yield a better solution.
 
I actually figured a way out. I should have tried a few more things before jumping into the forum, sorry for the waste of time.:(
 
I actually figured a way out. I should have tried a few more things before jumping into the forum, sorry for the waste of time.:(


Please do not consider any visit to the Fourm as a waste of anyone's time. Clearly, the following points were true at the time.
  • You had a question and were searching for an answer.
  • There were/are people here who try their best help others whenever they can.
It is good that you found an answer. I am also sure that sharing your solution to the problem might be beneficial because:
  • At some point in the future another user might have a similar problem and benefit from your solution.
  • The people on the Forum might be able to offer additional assistance if other issues related to this one arise
Good luck with your efforts, and please come back if you have any further questions.
 

Users who are viewing this thread

Back
Top Bottom