adding leading zeros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Just a quick question.....

I have one database that has enough leading zero's on a number to make
twelve digits (if the number is five digits it has 7 zeros, 6 digits and it
has 6 zeros). I need to compare it to another database where it has the same
number without the leading zeros.

Is there anyway to either add enough zero's to one or take them away from
the other ?

thank you!
 
I have one database that has enough leading zero's on a number to make
twelve digits (if the number is five digits it has 7 zeros, 6 digits and
it
has 6 zeros). I need to compare it to another database where it has the
same
number without the leading zeros.

Is there anyway to either add enough zero's to one or take them away from
the other ?

Format([Fieldname],"000000000000")

Tom Lake
 
Just a quick question.....

I have one database that has enough leading zero's on a number to make
twelve digits (if the number is five digits it has 7 zeros, 6 digits and
it
has 6 zeros). I need to compare it to another database where it has the
same
number without the leading zeros.

Is there anyway to either add enough zero's to one or take them away from
the other ?
Hi Chris,

I usually use

Right("000000000000" & [Fieldname],12)

one side effect is that if [Fieldname] is null,
it returns 12 zeroes (which I make use of,
but maybe you would rather get Null instead
using Tom's equally-valid example).

good luck,

gary
 
perfect!!!!! thank you both very much


Gary Walter said:
Just a quick question.....

I have one database that has enough leading zero's on a number to make
twelve digits (if the number is five digits it has 7 zeros, 6 digits and
it
has 6 zeros). I need to compare it to another database where it has the
same
number without the leading zeros.

Is there anyway to either add enough zero's to one or take them away from
the other ?
Hi Chris,

I usually use

Right("000000000000" & [Fieldname],12)

one side effect is that if [Fieldname] is null,
it returns 12 zeroes (which I make use of,
but maybe you would rather get Null instead
using Tom's equally-valid example).

good luck,

gary
 
Back
Top