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

seperate a sum total field into individual fields

Status
Not open for further replies.

dnanhawk

IS-IT--Management
Mar 24, 2010
2
US
I have a report which I created a "sum" field.

I need to seperate each position of that "sum" field to add to come up with another "sum" field.

example: 763.21 I need to come up with the sum of each position 7 + 6 + 3 + 2 + 1 = 19

Any ideas on how to accomplish this??????????
 
numbervar x := {table.sumfield};
stringvar y := replace(totext(x),".","");
numbervar i;
numbervar j:= len(y);
numbervar z := 0;
for i := 1 to j do(
z := z + val(y)
);
z

-LB
 
Thank you so much that worked perfectly!!!!!!!!!!!!!!

[2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top