Results 1 to 2 of 2
  1. #1
    pbaccess is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    2

    pulling out only numbers in an alpha-numeric field

    Hello,



    I have 2 tables that I need to join by sales order number. This is the only common field. Unfortunately, one of the tables has the sales order number formatted like this... SO#1234 and on of the tables has the sales order number formatted like this.... 1234.

    Is there any way to create a query that returns the sales order numbers of the first table without the "SO#" so that it matches table two? Or is there another way to link the fields that I'm not thinking about?

    Thank you in advance for your help!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Do these tables have a 1-to-1 relationship?

    Build a query with SO# table and create a field with expression that removes the SO#. Expression like: Replace([fieldname],"SO#",""). Then join that query to the other table.

    Or try:

    SELECT Table1.*, Table2.* FROM Table1, Table2 WHERE Table1.[order number] = Replace([fieldname],"SO#","");

    Omitting the join clause cause a Cartesian relation. A less efficient query and might slow performance.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. numeric field in table
    By msasan1367 in forum Access
    Replies: 13
    Last Post: 04-07-2013, 10:28 AM
  2. Alpha Numeric auto id?
    By arshadmgic in forum Forms
    Replies: 7
    Last Post: 09-02-2012, 03:00 AM
  3. Replies: 2
    Last Post: 09-25-2011, 08:52 AM
  4. Justify numeric text field
    By tpcervelo in forum Queries
    Replies: 2
    Last Post: 01-27-2011, 03:50 PM
  5. Recordset not showing alpha-numeric entries
    By rayhawk in forum Access
    Replies: 9
    Last Post: 10-29-2010, 08:15 AM

Tags for this Thread

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