Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    6

    Unanswered: Text Field - Adding leading zeros based on size

    I have a text field (ID) in tblList that contains data that can be different lengths. I need to be able to add the appropriate number of leading 0's to the numeric data so that when completed all of the data in that field will have the same length (7). This will than be used to link it to another table.

    As an example, I may have 1234 and I need it to be 0001234 or I'll have 12345 and I need it to be 0012345 but never longer than 7 characters.

    Now to mix it up a bit more, at times there may also be text data in the field that I need to skip over and not add any zeros.

    Any help on this would be deeply appreciated.

    Thanks,

    Larry

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi Larry

    http://www.dbforums.com/showthread.php?t=998160&page=2 will show more than you'll probably ever need to know about ways of adding leading charcters.

    Combine one of these with an expression to test for text data (something akin to Like "*[a-z]*" perhaps) and you should be in business
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •