Welcome to SPN

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

Sign Up Now!

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?
     

Share This Page