Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

How do I add three leading zeros to a number field ?

Discussion in 'Information Technology' started by Decembersonata, Nov 5, 2005.

  1. Decembersonata

    Decembersonata
    Expand Collapse
    Guest

    I have a database in which we are keeping track of pledge numbers. The
    pledge number string is ten characters long, however, all pledges at this
    point are only up to seven characters. When entering the pledge number into
    a field, how do I set it up so Access automatically adds enough zeros before
    the pledge number in order to make it ten characters long?
     
  2. Loading...


  3. Rick B

    Rick B
    Expand Collapse
    Guest

    A NUMBER would not need leading zeros. 000000000005 is exactly the same as
    5 or 0005 or 0000005. If you care about the zeros, you could change it to a
    text field. You could then run an update query to correct all the existing
    entries.


    Or, check out the "FORMAT" option in your field.



    --
    Rick B



    "Decembersonata" <Decembersonata@discussions.microsoft.com> wrote in message
    news:6638CD69-4082-4F47-A828-032CC9D0E18C@microsoft.com...
    >I have a database in which we are keeping track of pledge numbers. The
    > pledge number string is ten characters long, however, all pledges at this
    > point are only up to seven characters. When entering the pledge number
    > into
    > a field, how do I set it up so Access automatically adds enough zeros
    > before
    > the pledge number in order to make it ten characters long?
     
  4. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    When you open your pledge table in design view, what is the Data Type of
    this field?

    If is it Number, you can just set the Format property to 10 zeros, and it
    will display the leading zeros for you.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Decembersonata" <Decembersonata@discussions.microsoft.com> wrote in message
    news:6638CD69-4082-4F47-A828-032CC9D0E18C@microsoft.com...
    >I have a database in which we are keeping track of pledge numbers. The
    > pledge number string is ten characters long, however, all pledges at this
    > point are only up to seven characters. When entering the pledge number
    > into
    > a field, how do I set it up so Access automatically adds enough zeros
    > before
    > the pledge number in order to make it ten characters long?
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page