0

Select only hosts not working on a certain date from joined table.

We host events. Each event has a host. The host data is stored in a Host table. It is tied to the Event Details table  via (N:1). 

What would the query be to populate a view of all hosts from Host table that are NOT working on a chosen date? Essentially, show me all hosts from Host table that are not assigned to an Event on X date. 

A host will not be working more than 1 event on a date. 

Tables:
Event Details
Hosts

2 replies

null
    • Firefly Team Events
    • James.3
    • 4 days ago
    • Reported - view

    Currently using this code. If anyone knows a better or more efficient way to do it, please share:

    let chosenDate := 'Choose A Date';
    let workingHosts := (select 'Event Details' where 'Event Date' = chosenDate).Host;
    select Staff where contains(text(Roles), "Emcee") and not contains(workingHosts, this)

    (my original post called the staff table Hosts. But really it's Staff and there is a field that notes whether someone is an emcee)

      • Fred
      • 4 days ago
      • Reported - view

      if it works then that is great.