Results 1 to 2 of 2
  1. #1
    webisti is offline The Wisher
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    115

    matching number with leading zeros

    Hi

    I have two tables
    table a contains a list of numbers (ie invoice)
    10215
    10316
    15751
    16925
    016744
    012458

    table b contains the same numbers but with leading zeros:
    000000010215
    000000010316
    000000015751


    000000016925
    000000016744
    000000012458

    how can I make a match query to show me the results 1 ie: 10215 = 000000010215
    10316 = 000000010316
    012458 = 000000012458

    I tried the opposite with a module stripzeros() but that gives me wrong data as it removes all the leading zeros.

    any ideas?

    Thanks

    Webisti

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    This is one way to solve your issue.

    Create a query for table b and convert the leading zeros number and use that query to match back to table a.

    Like,

    1) Query for table b:
    SELECT CLNG(LEADINGZEROFIELDNAME) AS SOMEFIELDNAME FROM TABLE_B;

    2) Match/JOIN back to table a.
    SELECT A.NONLEADINGZEROFIELDNAME, B.SOMEFIELDNAME
    FROM TABLE_A INNER JOIN TABLE_B ON A.NONLEADINGZEROFIELDNAME = B.SOMEFIELDNAME;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Trying to get leading zeros to show
    By Pegasus_Angel in forum Access
    Replies: 3
    Last Post: 10-25-2012, 11:40 AM
  2. Leading Zeros in Access 2010
    By aa_weber in forum Access
    Replies: 3
    Last Post: 10-16-2011, 11:17 PM
  3. Leading Zeros
    By dirtbiker1824 in forum Access
    Replies: 1
    Last Post: 03-14-2011, 02:16 PM
  4. Adding Leading Zeros
    By jo15765 in forum Access
    Replies: 13
    Last Post: 11-20-2010, 11:11 PM
  5. leading 'Zeros' in data
    By wasim_sono in forum Forms
    Replies: 3
    Last Post: 04-06-2009, 11:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums