cycle through records and add to array (1 Viewer)

brucesilvers

Registered User.
Local time
Today, 09:49
Joined
Aug 4, 2000
Messages
70
I am attempting to create an index of items in a table. The data looks something like this:
Bob...2
Jerry...27
Bob...79
Phil...14
Jerry...53
Bob 102
etc.

I would like to create output like this:
Bob...2, 79, 102
Jerry...27, 53
Phil...14
etc.

Is it possible to cycle through the records and dump items into an array such as:
(Bob;2, 79, 102)
(Jerry; 27, 53)
etc.

OR - am I making this more difficult than it needs to be and is there an easier way to accomplish that?
 

Mile-O

Back once again...
Local time
Today, 17:49
Joined
Dec 10, 2002
Messages
11,316
brucesilvers said:
OR - am I making this more difficult than it needs to be and is there an easier way to accomplish that?
It certainly looks like you are making something more complicated than it need be but, given such limited information, it's even more difficult to say what you are making complicated.
 

checoturco

Registered User.
Local time
Today, 09:49
Joined
Oct 17, 2005
Messages
76
why you don´t use a table(name,number) and get the output with a query?
 

brucesilvers

Registered User.
Local time
Today, 09:49
Joined
Aug 4, 2000
Messages
70
More info

I have a table of quotations by various authors, with the following structure:

quote_id (integer, primary key)
author (text)
quote (memo)

Some of the authors appear only once, some of the authors appear a number of times.

I would like to output an index of quote_id's by author in the format:

author: quote_id, quote_id, quote_id

Sample Output:

Barrymore: 96
Cervantes: 116, 121, 126
Shakespeare: 15, 27, 138, 249
etc.
 

nateobot

Registered User.
Local time
Today, 11:49
Joined
Dec 13, 2005
Messages
86
Bruce,

What is it you plan on doing with the output after you have it? There might be a different (possibly better) method of doing it to give you the results.
 

brucesilvers

Registered User.
Local time
Today, 09:49
Joined
Aug 4, 2000
Messages
70
In the end, I'd like to create print-ready output to be included in the appendix of a book.

However, any output that groups author with however many entries (quote_id's) in the format I mentioned above is fine - a query, a report, unformatted text output, etc.
 

Users who are viewing this thread

Top Bottom