Hi!
This is (for my opinion) a difficult question:
I got one table "Clients"
ClientID, Name.
And another Table "ClientStates",
StateID, ClientID, Date, enabled.
One client can have multiple states, or none.
For example,
if Client 1, Miss X, has the following states:
1 | 1 | 9.1.2002 | yes
2 | 1 | 6.1.2002 | no
3 | 1 | 5.1.2002 | yes
4 | 1 | 1.1.2002 | no
then this table means that she is not to be served
from the first to the fourth of January, and from
the 6th to the 8th.
I need a query that lists all clients enabled at
a specific date, e.g. the 7th of January. Miss X
would then not be listed in this query's result.
If there is a client with no state (with Date
before the given date), he/she is assumed
"enabled".
How do I do that?
Thanks a lot,
This is (for my opinion) a difficult question:
I got one table "Clients"
ClientID, Name.
And another Table "ClientStates",
StateID, ClientID, Date, enabled.
One client can have multiple states, or none.
For example,
if Client 1, Miss X, has the following states:
1 | 1 | 9.1.2002 | yes
2 | 1 | 6.1.2002 | no
3 | 1 | 5.1.2002 | yes
4 | 1 | 1.1.2002 | no
then this table means that she is not to be served
from the first to the fourth of January, and from
the 6th to the 8th.
I need a query that lists all clients enabled at
a specific date, e.g. the 7th of January. Miss X
would then not be listed in this query's result.
If there is a client with no state (with Date
before the given date), he/she is assumed
"enabled".
How do I do that?
Thanks a lot,