Querying subdatasheets

K

KG

For a charitable organization, I have set up a database listing children's
guardians, their addresses, phone numbers, etc. Each guardian is identified
by a unique family number (primary key).

Under each guardian, I have inserted as a subdatasheet, the names of
children, their ages, etc. Each child is also identified by a unque code
number.

Is it possible to run a query that sorts out the guardians who have 2
children, 3 children, etc.?
 
M

[MVP] S.Clark

In a query you can perform a Count of the ParentID's against the child
records, to determine the number the parent has. Be vary in a foster parent
situation that children come and go, so you may have to incorporate a date
range in the query.
 
K

KG

Can this be done in the QBE panel or does it require SQL?

When I did a Count of the ParentID's I ended up with a count of 1 for each
parent, because each parent has a unique number; the same goes for a Count of
children's IDs because there is only child with that ID number. Obviously,
there is a fundamental flaw in the logic and design of my query but I can't
figure a way around it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top