Results 1 to 2 of 2
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    query code check please

    Hi



    I have two tables

    tblDeceased and tblMemorial

    I want to list all the records in tblMemorials that are not in tblDeceased based on criteria

    PlotNo, GraveNO and Mlink

    ie if any record in tblMemorial does not match all three criterial it is listed as not being in tbl Deceased.

    OK my code is here

    [CODE
    SELECT tblMemorial.Plot, tblMemorial.GraveNo, tblMemorial.Mlink
    FROM tblMemorial LEFT JOIN tblDeceased ON tblMemorial.[Mlink] = tblDeceased.[Mlink]
    WHERE (((tblDeceased.Mlink) Is Null)) AND (((tblDeceased.Plot) Is Null)) AND (((tblDeceased.GraveNo) Is Null));


    ][/CODE]

    I think I've been looking at this for two long and hence I'm going a bit brain dead

    Is my code good?

    thanks

    Ian

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    You will need some additional JOINS

    Something like ...
    Code:
    SELECT tblDeceased.Plot, tblDeceased.GraveNo, tblDeceased.Mlink
    FROM tblDeceased LEFT JOIN tblMemorial ON (tblDeceased.Mlink = tblMemorial.Mlink) AND
    (tblDeceased.Plot = tblMemorial.Plot) AND
    (tblDeceased.[GraveNo] = tblMemorial.[GraveNo])
    WHERE (((tblMemorial.GraveNo) Is Null) AND ((tblMemorial.Plot) Is Null) AND ((tblMemorial.Mlink) Is Null))

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

Similar Threads

  1. Code check please -query asking for perameter
    By Jen0dorf in forum Access
    Replies: 3
    Last Post: 08-25-2016, 03:13 PM
  2. Replies: 2
    Last Post: 07-27-2015, 05:20 PM
  3. Check Box VBA code in a form
    By alirezamb in forum Access
    Replies: 3
    Last Post: 02-17-2015, 04:35 PM
  4. Replies: 5
    Last Post: 06-26-2014, 12:52 PM
  5. Replies: 4
    Last Post: 03-10-2014, 12:18 PM

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