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

Running Total Field sum changed "To Text"

Status
Not open for further replies.

piovesan

Technical User
Jan 23, 2002
159
CA
Hi there;

I have created two running total fields for costs. I want to add these two fields together in the report, so I take one of the fields and in the "display" string formula editor, I an adding them, but I get an error message saying the "formula result must be a string". So, I can use the To Text function, but then I can't format the result the way I want it to look like as a number.... so I have:
"$"&(({#hrmparcel_costs}+{#modparcel_costs}))

Which works and adds up Ok for me, but I get the cost looking like $34590235 where I would prefer to have the thousand seperators $34,590,235

Is there a way I can do this?
Thanks!
 
You could do it the old fashioned way and manually add the commas into the text string. The last time I did it was probably before Windows existed. But it it works something like this. Take the string, count back three from the right end of the string and add in a comma, continue to do so until your run out of string.

If I get some time, I will see if I can work up some code.

I hope this helps.
 
If you change the formula to:

{#hrmparcel_costs}+{#modparcel_costs}

...you should be able to right click on it->format field->numbers and change the format there. You can also handle it by just using the comma and $ icons. The problem is your use of an ampersand instead of a + (and you don't need the $).

Or, to change it to text, it would be:

"$"+totext({#hrmparcel_costs}+{#modparcel_costs},0)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top