Loop Count

  • Thread starter Thread starter NeonSky via AccessMonster.com
  • Start date Start date
N

NeonSky via AccessMonster.com

Hello,

I have a rather straightforward question for your consideration.

My source table is as follows.....

FieldA FieldB
Joe 23, 45
Joe 42, 65, 504

What I would like my output to perform is as follows....where field C is a
count of the number of strings in FeldB

FieldA FieldB FieldC
Joe 23, 45 2
Joe 42, 65, 504 3

My source data does indeed include commas in the field, and the values are
distinct. I understand this is poor index structure though these outputs are
specific to a process that references properly indexed data.

Would anyone know how to set up a loop/counter that scans a field for an
occurance of a comma, counts these occurances, then when it is all said and
done adds +1 to the total. Then finnaly generates these counts to the proper
field (the field that is to store the count does not exist in the source data
table).

Thank you!
 
Hi,
is there any way to get the count information from the properly indexed data
before it is put into this field with commas separating it? This would be
easier if it is possible to access the normalised data first.

Jeanette Cunningham
 
Hello Jeanette,

Thank you for your response.

I was fortunate enough to receive an answer that sums this up at the query
level. In case you might be interested.... Len(FieldX) - Len(Replace(FieldX,
",", "")) + 1 (by Marshall Barton).

Happy Holidays!

Jeanette said:
Hi,
is there any way to get the count information from the properly indexed data
before it is put into this field with commas separating it? This would be
easier if it is possible to access the normalised data first.

Jeanette Cunningham
[quoted text clipped - 28 lines]
Thank you!
 
Hi,
This is the same issue that Marsh has just answered in another post from
you.
Jeanette Cunningham
 
Try this if each is separated by a comma ---
String_Elements: (Len([FieldB])-Len(Replace([FieldB],",","")))+1
 
Thanks Jeanette, I am well aware of the multipost rule. An earlier answer to
my other post suggested a loop/count, thus I made another post in regards to
that. Then Marshall made his post after I posted here. Just in case you might
want to know..... Thanks And happy holidays!

Jeanette said:
Hi,
This is the same issue that Marsh has just answered in another post from
you.
Jeanette Cunningham
[quoted text clipped - 28 lines]
Thank you!
 
Thanks Jeanette, I am aware of the multipost rule and can understand why it
exists. An earlier answer to my other post suggested a loop/count, thus I
made another post in regards to that. Then Marshall made his post after I
posted here. Just in case you might want to know..... Thanks And happy
holidays!

Jeanette said:
Hi,
This is the same issue that Marsh has just answered in another post from
you.
Jeanette Cunningham
[quoted text clipped - 28 lines]
Thank you!
 
Back
Top