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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Occurence 1

Status
Not open for further replies.

eebabe

IS-IT--Management
Jul 17, 2003
54
0
0
US
Hello:

Environment: CRX

field1: PC 647(F) PC 647F,647F,647F,647F,647F CONDITI ;PC 148(A) 30/10

would like to count how many times the variation of PC 647(F) or 647F or 647(F)occurs in this field. I tried instr function but only gives me the first occurence.

Thanks.
 
stringvar x := {table.string};
stringvar y := replace(replace(x,"(",""),")","");
numbervar i;
numbervar j := len(y);
numbervar cnt := 0;
for i := 1 to j do(
if y+y[i+1]+y[i+2]+y[i+3] = "647F" then
cnt := cnt + 1
);
cnt;

-LB
 
Thanks LB. Worked like a charm. You ROCK!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top