Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:11:48+00:00 2026-06-04T12:11:48+00:00

I’m writing a contacts & events database and want to view those contacts that

  • 0

I’m writing a contacts & events database and want to view those contacts that have not been invited to a specific event. I have the following tables and queries:

Contacts – Table
Events – Table
ContactInvitation – Table (creates PK of EventID & ContactID to show who has been invited to which event)

Guests&Events – Query (shows all instances of contacts and and the events they have been invited too)

In Guests&Events if a contact has not been invited to an event the event field is blank. If they have been invited to more than one event there are duplicte contacts names showing the events they are invited to. e.g.

Mark – Null
Sean – Null
Steven – Event 1
Steven – Event 2
Mike – Event 1
Jill – Event 1
Rob – Event 2

I now want to filter these contacts to show only (1 instance of each contact) that has not been invited to a specific event. E.g. show all contacts that have not been invited to Event 1.

The query for NotInvited to event 1 shouldshow Mark, Sean & Rob.

However, I am having difficulty with the fact that Steven is invited to Event 1 & 2 so if I filter on “Event<>1 OR Event=Null) Steven will still appear in the list even though he has been invited to Event 1.

Please help! This has been driving me crazy. I have spent the last couple of days googling and although I have now learned about GROUPBY and sub queries I can’t seem to work out a solution.

Many thanks in advance for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:11:50+00:00Added an answer on June 4, 2026 at 12:11 pm

    I would first remove all rows from the ContactInvitation that have NULLs. They are useless and may cause trouble. If a Person has not been invited to an event, you simply have no row for that (invitation) in the table. No need to put rows with Nulls.

    DELETE FROM ContactInvitation 
    WHERE EventID IS NULL ;
    

    Then you could use this query:

    SELECT c.*
    FROM Contacts AS c
    WHERE NOT EXISTS
          ( SELECT * 
            FROM ContactInvitation AS i
            WHERE i.ContactID = c.ContactID
              AND i.EventID = 'Event 1' 
          );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a view passing on information from a database: def serve_article(request, id): served_article
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a small JavaScript validation script that validates inputs based on Regex. I
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I need a function that will clean a strings' special characters. I do NOT
I have a reasonable size flat file database of text documents mostly saved in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.