Results 1 to 3 of 3
  1. #1
    btappan is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2013
    Posts
    43

    Not Like wildcard based on another field

    I use the query below to arrange the data further down. I'm trying to use something like VariantName Not Like UnionBases.pNAME* so that the first two rows wouldn't be returned because they contain the string 'ABC321' in both pNAME and VariantName. I can't seem to get it to work though. Any suggestions?



    Code:
    SELECT UnionBases.pNAME, BaseVariants.bName, BaseVariants.VariantName, ItemsByBins.QtyOnHand, ItemsByBins.Bin, IIf([BinLocations].[IsStk]=True,'STOCK','') AS Stock, ItemsByBins.QtyOnSO, ItemsByBins.QtyOnPOFROM ((BaseVariants INNER JOIN ItemsByBins ON BaseVariants.VariantName = ItemsByBins.VariantName) INNER JOIN UnionBases ON BaseVariants.Bases.ID = UnionBases.Base) INNER JOIN BinLocations ON ItemsByBins.Bin = BinLocations.Bin
    WHERE (((BaseVariants.VariantName) Not Like [UnionBases].[pNAME]*) AND ((ItemsByBins.QtyOnHand)>0))
    ORDER BY UnionBases.pNAME, BaseVariants.VariantName;
    pNAME VariantName bName QtyOnHand Bin Stock QtyOnSO QtyOnPO
    ABC321 ABC321-FNP ABC3060 1.00 3-24 0.00 0.00
    ABC321 ABC321-RECD ABC3060 1.00 10-1 STOCK 0.00 1.00
    ABC321 ABC322-RECD ABC3060 2.00 10-3 STOCK 0.00 0.00
    ABC321 ABC322-RECD ABC3060 1.00 10-10 STOCK 0.00 0.00
    ABC321 ABC351-RECD ABC3060 1.00 3-54 0.00 0.00
    ABC321 ABC351-RECD ABC3060 5.00 3-38 0.00 0.00
    ABC321 ABC351-RECD ABC3060 27.00 2-115 0.00 14.00
    ABC321 ABC351-RECD ABC3060 1.00 1-109 STOCK 0.00 0.00
    ABC321 ABC352-RECD ABC3060 2.00 1-109 STOCK 0.00 0.00
    ABC321 ABC352-RECD ABC3060 1.00 10-8 STOCK 0.00 0.00
    ABC321 ABC352-RECD ABC3060 3.00 10-7 STOCK 0.00 0.00
    ABC321 ABC352-RECD ABC3060 2.00 10-6 STOCK 0.00 0.00
    ABC321 ABC352-RECD ABC3060 1.00 10-10 STOCK 0.00 0.00
    ABC321 ABC352-RECD ABC3060 11.00 2-115 4.00 0.00

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,830
    try

    BaseVariants.VariantName Not Like [UnionBases].[pNAME] & "*"

  3. #3
    btappan is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2013
    Posts
    43
    I knew it'd be something simple like that, thanks man!

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

Similar Threads

  1. Replies: 3
    Last Post: 06-14-2018, 12:05 PM
  2. Replies: 2
    Last Post: 11-01-2016, 07:32 AM
  3. Replies: 9
    Last Post: 12-05-2013, 11:48 AM
  4. Replies: 2
    Last Post: 04-04-2013, 03:13 PM
  5. Wildcard Expressions in Search Field
    By eww in forum Programming
    Replies: 4
    Last Post: 09-29-2010, 10:27 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