Remove dollar sign and commas

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Andrew_Bokelman
Posts: 14
Joined: Tue Oct 10, 2017 12:44 pm

Remove dollar sign and commas

Post by Andrew_Bokelman » Mon Oct 01, 2001 4:03 pm

I have a text field that contains dollar amounts with a dollar sign and one or more commas. I want to use the val() of this field but I need to get rid of the junk first. ____What would be a function or functions I can use to strip out a dollar sign and all commas. Removing everything that is not 0 to 9 will also work____BTW, I^ve already tried substr(), stuff(), and at() but I can^t figure out how to get rid of more than the dollar sign and one comma this way.____

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Remove dollar sign and commas

Post by kfleming » Tue Oct 02, 2001 8:13 am

You can use the calc expression____STRREP(STRREP(fieldname, "," ,""),"$" ,"")____to strip , and $ from a field where fieldname is the name of the field containing the , and $.____Here is info from the help file:__Syntax:____STRREP(C1,C2,C3,L) where C1 is the full character expression, C2 is the substring to be replaced, and C3 is the replacement substring. The optional logical expression L controls the case sensitivity of the function. When L is true, the function is case sensitive; when it is false, the function is case insensitive. When this argument is not provided, the function uses the case sensitivity setting in the RRW.SRT file ____Example:____To replace every occurrence of the text "LP" with "Liveware Publishing" in a character field named COMMENT, create a field with the following expression:___STRREP(COMMENT,"LP","Liveware Publishing")______Kathleen__R&R Support

Andrew_Bokelman
Posts: 14
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Remove dollar sign and commas

Post by Andrew_Bokelman » Tue Oct 02, 2001 2:49 pm

Thanks. I don^t know how I missed that function, but I did. Thanks for the clear example.

Post Reply