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!

Leading zeros in a text field???

Status
Not open for further replies.

ddbrook

Programmer
Aug 19, 2002
17
0
0
US
I have a text field but outputs numbers...
I need the leading 2 zeros taken off. I have tried trim.
I have a query and my data outputs like this:

Meter #,
0054641

I need it to look like:
54641

Please help...

Thanks,
ddbrook


 
Hi,
Try the following code. It will remove all leading zeroes.

Do While (Left(Text1, 1) = 0)
Text1 = Right(Text1, Len(Text1) - 1)
Loop

Hope it helps. Let me know what happens.
With regards,
PGK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top