A
Allison
Access 2000, Win XP SP2
Hi all,
I'm looking for a cleaner way to determine whether or not an entry in one
table has a specific field checked yes or no in another table.
Table 1:
fldVendorID (Primary key, no dupes)
fldVendorName
Table 2:
fldVendorID (dupes allowed)
fldContact
fldAllowed
Table 2 can have many fldContacts per each fldVendorID from Table 1.
fldAllowed is a yes/no field.
I want to query for any VendorID which has NO fldAllowed=yes.
I've done it this way:
Query 1 counts all contacts from Table 2, grouped by fldVendorID
Query 2 counts all fldAllowed="No", grouped by fldVendorID
Query 3 joins both fields of Queries 1 and 2, and returns results only if
both field counts from the two queries match each other.
This works. But, can it be done cleaner? If so, how?
Hi all,
I'm looking for a cleaner way to determine whether or not an entry in one
table has a specific field checked yes or no in another table.
Table 1:
fldVendorID (Primary key, no dupes)
fldVendorName
Table 2:
fldVendorID (dupes allowed)
fldContact
fldAllowed
Table 2 can have many fldContacts per each fldVendorID from Table 1.
fldAllowed is a yes/no field.
I want to query for any VendorID which has NO fldAllowed=yes.
I've done it this way:
Query 1 counts all contacts from Table 2, grouped by fldVendorID
Query 2 counts all fldAllowed="No", grouped by fldVendorID
Query 3 joins both fields of Queries 1 and 2, and returns results only if
both field counts from the two queries match each other.
This works. But, can it be done cleaner? If so, how?