How to make a query more simple?

  • Thread starter Thread starter hermie
  • Start date Start date
H

hermie

In my database I have 9 checkboxes for different work situations, 1 field
called age, and a field with the event numbers. From this database I created
a complex query with many fields to calculate the totals of participants in
the different work situations.

I have 6 groups of ages For example for the first work situation in the
age group 17 years or less, I made the next expression to calculate the
total:

age11: Sum(IIf([trabtiemcomp]=True And [age] Between 18 And 21,1,0))

This works fine but I have to do this 54 times plus 9 times for the totals.



A crosstab query not works, Is there is more simple solution to make these
solution?





Hermie
 
Unfortunately, the real problem here is with your table design. Instead of
9 yes/no fields, there should be one field holding the value of the work
situation. Each work situation would have a separate record. It is easy
then to have SQL query such data.

What you have done is "spreadsheet thinking" and that sort of design creates
the very problem you are describing.

I realize this is not much help in your present circumstance, and I'm sorry.
But the real fix is to fix the table structure. If you don't, problems will
continue to haunt you.
 
Back
Top