Results 1 to 2 of 2

Thread: Select Statement.... HELP

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    7

    Wink Select Statement.... HELP

    I have two tables that look more or less like this:

    Member:
    idMember Name Surname
    1 John Watts
    2 Pete Pletz
    3 Carl Bekker

    History
    idHistory idMember DataA DataB
    1 2 AAAAAAAA BBBBBBBB

    All I want is an access select statement that would show me the members that does not have any History entries, thus, members 1 and 3

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Select Statement.... HELP

    Questions about SQL statements are generally better in our Database Development forum, as many 'experts' regularly go there - you are lucky that I saw this thread! (I can move the thread there if you want)

    A simple sub-query should work nicely...
    Code:
    SELECT idMember, [Name], Surname
    FROM Member
    WHERE idMember NOT IN (SELECT idMember FROM History GROUP BY idMember)
    (the Group By part is only to make it faster - it is basically a 'Distinct')

Posting Permissions

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



Click Here to Expand Forum to Full Width