mysql - Junction table - EXCEPT replacement -


i have relationship seen below, employees , trainings, each employee can participate in training it's basic m:m 1:m m:1 stuff.

erd have combo box select employee, , want 2 list boxes list completed trainings , available trainings

something this: enter image description here

and have 2 buttons moves selected 1 list box other , changes records accordingly.

i have made query list trainings employee participated in:

select training.name, training.trainer, training.cost, training.type, training.[length(day)] training inner join participation on training.[training id] = participation.training (((participation.employee)=[forms]![add training 2]![cboemp])) order training.name; 

i have problem selecting trainings , filtering out ones have been selected in sql query above simple except work access doesn't support it.

this want:

select training.name, training.trainer, training.cost, training.type, training.[length(day)] training except select training.name, training.trainer, training.cost, training.type, training.[length(day)]= training inner join participation on training.[training id] = participation.training (((participation.employee)=[forms]![add training 2]![cboemp])) order training.name; 

you can use not exists or not in:

select training.name, training.trainer, training.cost, training.type, training.[length(day)] training training.trainingid not in (select participation.training                                   participation                                    participation.employee = [forms]![add training 2]![cboemp]                                  ) order training.name; 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -