Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Removing leading Zeros (Access 2003 SP2)

    I import a table where the Employee Number is formatted: EMP_00004567 (TEXT Field)

    I use a partial Text extract Query to eliminate the "EMP_" leaving me with 00004567

    So far I remove the Leading Zero manuall by: 1) Changing the TEXT field to a NUMBER field in Design View and SAVE. Then changing it back to TEXT. (It needs to be in TXT)

    I want to automate this as it is updated weekly.

    What Update query can I use to remove the LEADING zeroes without having to change the Table Design?

    Thanks

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Removing leading Zeros (Access 2003 SP2)

    You could use an expression like this in the update query based on the imported table:

    CStr(Val(Mid([Employee Number],4)))

    The Mid function removes the "EMP_" part, Val converts the remainder to a number and CStr converts this number back to text.

  4. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing leading Zeros (Access 2003 SP2)

    Thank yo... I will test

Posting Permissions

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