adding leading zeros

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!
 
T

Tom Lake

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
 
G

Gary Walter

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top