+ Reply to Thread
Results 1 to 6 of 6

SQL Query - Unmatched tables with a condition

  1. #1
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    SQL Query - Unmatched tables with a condition

    Hi all.

    I have two tables. One table has a basic list of items (Apples, Pears, Bananas, Oranges, etc). Lets call this tblFruit. This table looks like this.

    ID | Fruit Name

    The other table contain records of customer selections. A customer can select many different types of fruit. Lets call this tblPurchases. Table purchase looks like this

    ID | Customer ID | Fruit Bought

    I need a query that tells me what selections the customer hasn't made. The condition is that I can select any customer I want so that it would probably require the Customer ID

    I tried using the unmatched wizard but didn't work. it keeps on showing me selections the customer did make, which is the complete opposite of what I need.

    The reason I need this is so that I can make a combo box that shows choices left to make and does not display choices already made.

    Any help appreciated.

    Cheers

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: SQL Query - Unmatched tables with a condition

    Like this maybe:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Re: SQL Query - Unmatched tables with a condition

    Thanks Kyle.

    Unfortunately I keep getting a JOIN expression not supported error. It occurs on the 'AND sel.[Customer ID]=1 line.

    I don't know how to fix that. Can you advise please.

    Cheers

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: SQL Query - Unmatched tables with a condition

    The SQL is fine, I think it may be an access syntax thing - I don't have it so I'll ask for some help

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: SQL Query - Unmatched tables with a condition

    Change the 1 to your Customer ID
    Attached Images Attached Images
    Attached Files Attached Files


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  6. #6
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Re: SQL Query - Unmatched tables with a condition

    Alright, thank you for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to put Condition in Query column?
    By toci in forum Access Tables & Databases
    Replies: 3
    Last Post: 02-21-2016, 08:43 PM
  2. [SOLVED] Excel Condition Query
    By Dnyan in forum Excel General
    Replies: 5
    Last Post: 08-21-2014, 07:54 AM
  3. [SOLVED] Access unmatched query returning Blank Results
    By jonboy6257 in forum Access Tables & Databases
    Replies: 4
    Last Post: 12-04-2013, 10:46 AM
  4. how to use if condition for more than one query
    By genetist in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-09-2013, 05:47 PM
  5. [SOLVED] sql query condition from cell value - how?
    By azhanurul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2012, 07:33 AM
  6. Query 2 Tables
    By kingdt in forum Access Tables & Databases
    Replies: 7
    Last Post: 12-14-2011, 02:08 PM
  7. Run query from two tables
    By WT2008 in forum Access Tables & Databases
    Replies: 1
    Last Post: 07-13-2010, 02:17 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1