Avg difficulties 
Author Message
 Avg difficulties

Hi! I am having difficulty in coming up with a way to average groups of
values on a current record. I am using Access '97.

I have developed a database application that charts results from a
questionnaire. Each questionnaire has 112 questions to which there is an
answer (0,1,2,3,4 or X). The answers are entered into a form creating a
record. The table format as a textfile would look like this (with the
customer number at the beginning):

STONG01,1,0,X,2,4,4,3,2,4,1,1,0, etc...(113 fields)
JONES04,0,1,2,3,4,2,1,4,X,4,3,0, etc...

What I need to do is (using only the current record showing in the form)
to average the first 7 answer values (fields) and put that result either
in a variable or on another form. Then the next 7 answer values must be
averaged and the result put in a different variable. I would end up with
six{*filter*} unique variables with resulting averages in them. How do I do
this in a function considering I had to use text fields in the table
because some of the answer values are text ("X"). Also, the values need
to be taken from the current record in the table because the answer
values aren't on the form (The averaged results end up being used in an
embedded chart on the same form). As well, only values not "X" can be
averaged so I might average 6 or 5 values.

I would think the function would have to loop through each group of 7
answer values, using the variant datatype, count the valid answer values
within each group of 7 answers, sum the valid answers and divide by the
count. Or can the Access Avg function be used?

Am I on the right track? I have tried queries with limited success. The
Avg function in MS Excel worked fine because of the "general" data
format, but I can't use that as a datatype in a table.

Help would be appreciated! Thanx!

Mon, 06 Dec 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Unknown error in Avg(TimeValue) Function

2. SQL AVG MAX etc.

3. Problems with Oracle AVG() and VB5

4. Data Report Designer Avg Problems

5. Question about avg. VB consultant pay

6. Help need formula or logic for computing avg daily balance

7. sorry: 12 weeks rolling avg

8. 12 rolling avg

9. Calculate max and avg's for running totals


11. SQL AVG a Time Field

12. VB TransferText Command difficulties


Powered by phpBB® Forum Software