Results 1 to 4 of 4
  1. #1
    Blair is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2015
    Posts
    4

    Question Left join with in-instrin

    I have a table called “drawingchange”


    DRAW ECN
    1222 001
    1222 002
    1333 222
    1333 223
    1333 224
    1555 333
    5556 334

    And another tablecalled “Prodchange”
    Prod ProdECN Parent
    aaa 001, 002 L123-00
    bbb 001, 999, 334 L133-00
    ccc 333, 002 L562-22
    ddd org L566-11
    eee Org, 001 L966-22
    fff 224, 001 L321-11
    ggg 334 L562-11

    I would like to Left join / in-string search….show all “drawingchange” records and any matches from ECN to ProdECN

    DRAW ECN Prod ProdECN Parent
    1222 001 aaa 001, 002 L123-00
    1222 001 bbb 001, 999, 334 L133-00
    1222 001 eee Org, 001 L966-22
    1222 001 fff 224, 001 L321-11
    1222 002 aaa 001, 002 L123-00
    1222 002 ccc 333, 002 L562-22
    1333 222
    1333 223
    1333 224 fff 224, 001 L321-11
    1555 333 ccc 333, 002 L562-22
    5556 334 ggg 334 L562-11

    any ideas?

  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.

    Change your table "Prodchange" design.
    Prod ProdECN Parent
    aaa
    aaa
    001
    002
    L123-00
    L123-00
    bbb
    bbb
    bbb
    001
    999
    334
    L133-00
    L133-00
    L133-00
    ccc
    ccc
    333
    002
    L562-22
    L562-22
    ddd org L566-11
    eee
    eee
    Org
    001
    L966-22
    L966-22
    fff
    fff
    224
    001
    L321-11
    L321-11
    ggg 334 L562-11

  3. #3
    Blair is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2015
    Posts
    4
    That was my first thought too…Sadly, that table, for many reasons needs to stay as is.
    It’s an EPR table that feeds many other reports and queries within our business.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Try:

    SELECT drawingchange.*, prodchange.*
    FROM drawingchange, prodchange
    WHERE (((prodchange.ProdECN) Like "*" & [drawingchange].[ECN] & "*"));

    or

    Query1
    SELECT prodchange.Prod, prodchange.ProdECN, prodchange.Parent, drawingchange.ECN, drawingchange.DRAW
    FROM prodchange, drawingchange;

    Query2
    SELECT Query1.DRAW, Query1.ECN, Query1.Prod, Query1.ProdECN, Query1.Parent, InStr([ProdECN],[ECN]) AS Expr1
    FROM Query1
    WHERE (((InStr([ProdECN],[ECN]))>0))
    ORDER BY Query1.DRAW, Query1.ECN, Query1.Prod;

    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. Inner Join works but not Left Join
    By kwooten in forum Queries
    Replies: 1
    Last Post: 12-11-2012, 05:09 PM
  2. Left Join not
    By j_a_monk in forum Queries
    Replies: 5
    Last Post: 08-07-2011, 09:47 AM
  3. inner, left or right join ?
    By toqilula in forum Access
    Replies: 0
    Last Post: 04-11-2011, 12:20 AM
  4. Replies: 3
    Last Post: 02-02-2011, 01:00 PM
  5. Left join problem
    By e.badin in forum Queries
    Replies: 5
    Last Post: 01-17-2011, 08:03 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