Counting

A

Andrew

I have created a data base with provision for children's
names and the fields are called child1, child2 etc. Is
there a way i can ask the system to count the number of
children in each record automatically and enter this in a
field called "Number of Children"

Thank you
 
M

Mike Painter

Andrew said:
I have created a data base with provision for children's
names and the fields are called child1, child2 etc. Is
there a way i can ask the system to count the number of
children in each record automatically and enter this in a
field called "Number of Children"

Yes, use the relational prpoerties of a database and have a separate table
for children. Then it is easy and can be done without code on a report.
 
J

John Vinson

I have created a data base with provision for children's
names and the fields are called child1, child2 etc. Is
there a way i can ask the system to count the number of
children in each record automatically and enter this in a
field called "Number of Children"

Your table is incorrectly designed.

If you have a one family to many children relationship, the proper
table structure is to have TWO tables - a table of families, related
one to many to a table of children.

With this design you can easily calculate (but not store, it's
redundant and unnecessary) the number of records in the Children table
for an individual family.


John W. Vinson[MVP]
 

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

Similar Threads


Top