Hello !
I have 2 tables:
tblHouses (ID_House)
tblBulbs (ID_Bulb, ID_House, HasLight)
In tblBulbs the "ID_House" field is a look up on tblHouses and the "HasLight" field is of type Yes/No.
Now:
1) If each bulb in a house has light (HasLight=Yes), is OK.
2) If each bulb in a house hasn't light (HasLight=No), is, again, OK.
3) If some bulbs in a house have light and some bulbs in the same house haven't light, is NOT OK.
The question is:
How can I find the houses in situation 3) ?
I am looking for a smart solution, because I already have a solution "in force" :
In a query I have counted the bulbs from each house, in other query I have counted the bulbs with light for each house and, finaly, in the third query I do the comparation between the first and second query.
Thank you !
I have 2 tables:
tblHouses (ID_House)
tblBulbs (ID_Bulb, ID_House, HasLight)
In tblBulbs the "ID_House" field is a look up on tblHouses and the "HasLight" field is of type Yes/No.
Now:
1) If each bulb in a house has light (HasLight=Yes), is OK.
2) If each bulb in a house hasn't light (HasLight=No), is, again, OK.
3) If some bulbs in a house have light and some bulbs in the same house haven't light, is NOT OK.
The question is:
How can I find the houses in situation 3) ?
I am looking for a smart solution, because I already have a solution "in force" :
In a query I have counted the bulbs from each house, in other query I have counted the bulbs with light for each house and, finaly, in the third query I do the comparation between the first and second query.
Thank you !
Comment