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

Changing 4 digits to 8

Status
Not open for further replies.

samimichaels

IS-IT--Management
Nov 17, 2000
20
US
I have a numeric field that currently holds 4 digits but will grow. So I want the 4 digits to have leading zeros. i.e. 4456 to 0004456.

Help.

Thanks
 
This means that you'll convert it to a string:

replicatestring("0", 8 - length(totext({MyTable.MyField},0))) + totext({MyTable.MyField},0)

This doesn't use decimals nor insert thousands separators.

-k kai@informeddatadecisions.com
 
a simpler way to pad with zeros would be to convert it to a string using this

totext({Table.numberfield},"00000000") Jim Broadbent
 
It isn't original....I learned this some time ago from someone here....

That is what I like about this site....you always learn something new....and reinforce things that you may forget. :) Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top