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

remove leading 0 in text 1

Status
Not open for further replies.
Sep 12, 2005
448
US
hi guys and Gals
I have this issue
CR XI
Acess database query

I have a report that has 3 fields
key, dun tax id and cmsi tax id

in some of the field i had "-"
ex:12-345-67
and some might have space in front, mid, and end
so created 2 formula like this but different name for diffrent data collumn
@remove-
trim(replace({my_field},"-",""))
that took care of the "-" and spaces if there any
but some other had spaces instead of "-"

but some how there was still some spaces after i created these formula
so created other like this
replace(@remove-{," ","")
that did it
BUTTTTTTTTTTTTTT

then filter my report to show only data that mismatch
in the report->selection->records
i place this
{@Remove-} <> {@remove2}
that work
ex:
key collumn1 collum2
1 12345
2 456789
3 01243 1243

ERRORRRRRRRRRRRR
01243 is the same as 1243 except the leading 0 is visible
if i take the leading 0 out there identical

how can i get the leading 0 out to have it match to the other

thanks

PS it could be in any collumn





some have the same data but there a leadind 0

Durango122
 
Try this


Code:
stringvar x := trim({table.field})

x := replace(replace(x,"-","")," ","");
if isnumeric(x) then
  totext(tonumber(x))
else
  x
 
Hi
thank
i got this now

old was this
061267355
now i'm getting
61,267,355.00
would like
61267355

thanks



Durango122
 
Hi,
Try the Help section for formatting information..

Anyway, right-click on the object and select the formatting option you need..


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
hi turk
I tried left
trim
righ
and nothing works
i need to ge the , and the .00 out of the result

old was this
061267355
now i'm getting
61,267,355.00
would like
61267355

can someone help please


Durango122
 
Modifying the formula shoud do it

Code:
x := replace(replace(x,"-","")," ","");
if isnumeric(x) then
  totext(tonumber(x)[b][red],0,""[/red][/b])
else
  x
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top