G
Günter Brandstätter
Hi all,
I have a problem resolving a sub query. Heres what I've got:
database Fairground
A table 'STANDS' with a stand number and a descrition
A table 'Stands allocated' with the standnumber, the year and the client.
both tables are in relation via standnumber.
A combobox which should show me the stands available.
What I am trying to figure out is a query which shows me all free stands for
a particular year. (Free stand is when no record exists in the 'Stands
allocated' table for the stand selected and the particular year.
What I am doing now in Code is to fill a recordset with
all the stands and then browse this recordset one by one to put a query on
each stand in the table 'stands allocated'. When the recordcount of the
query is 1 then I know that the stand is already in use. With this I am able
to fill my combobox.
What I want to know: Isn't there a SQL instruction for this issue. I am
thinking since two days about this but I can't see a solution. I tried
subqueries but my SQL knowledge isn't that good to be able to resolve this
problem on my own.
Could anyone help me please???
thanks in advance
Günter
I have a problem resolving a sub query. Heres what I've got:
database Fairground
A table 'STANDS' with a stand number and a descrition
A table 'Stands allocated' with the standnumber, the year and the client.
both tables are in relation via standnumber.
A combobox which should show me the stands available.
What I am trying to figure out is a query which shows me all free stands for
a particular year. (Free stand is when no record exists in the 'Stands
allocated' table for the stand selected and the particular year.
What I am doing now in Code is to fill a recordset with
all the stands and then browse this recordset one by one to put a query on
each stand in the table 'stands allocated'. When the recordcount of the
query is 1 then I know that the stand is already in use. With this I am able
to fill my combobox.
What I want to know: Isn't there a SQL instruction for this issue. I am
thinking since two days about this but I can't see a solution. I tried
subqueries but my SQL knowledge isn't that good to be able to resolve this
problem on my own.
Could anyone help me please???
thanks in advance
Günter