Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing values from a field as one value

Status
Not open for further replies.

air1jcw

Technical User
Jan 23, 2003
30
US
Hi there,

Heres the deal. I am trying to build a query that shows misc. values from a field as one value in another field. Meaning I have a value in field A (a repitive value),and I want to see all the other values (associated with the repitive value in field A) from field B in a newly created field. For example, I think the "new" value in the new field will show something like: 1,2,3,4, etc.
Please help me out!!!!
Thanks - air1jcw
 
Hi,

Are you saying that you may have 4 records, 1st has '1' in Field A, 2nd has '2' etc.

You want to create a 5th record and enter "1,2,3,4" into field A of this new record?

If so, you need to define a variable called say MyVar, move to the first record, say MyVar = MyVar & fieldA.

Movenext, and MyVar = MyVar & "," & fieldA.
Movenext, and MyVar = MyVar & "," & fieldA.

etc.

Regards,

Darrylle
"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Hi again,

Air emailed me, and the reqmnt is:

tbl
field A 'key
field X 'value

Get the values from field X, grouped on Field A and concatenate field X into one string, delimiting each value with commas.

OK, Air - WHERE do you want the resultant value placed?
You can't put it in the current record, becasue there isn't one - you have many records.

Kind regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top