Counting

  • Thread starter Thread starter Andrew
  • Start date Start date
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
 
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.
 
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]
 
Back
Top