Hello,
I am setting up the database that contains the following fields:
A1, A2, A3, B1, B2, B3, C1, C2, and C3. All fields are set up numeric which allowed the inputs of 1, zero or null.
The A set will go together. So does the B set and the C set. I need to set up a query that will compute an average for the A set, B set and C set. So, I created three calculated fields, AVGA, AVGB and AVGC.
Remember, the null value is in there. The field is set up as numeric/byte.
These are some of my data, 4 records, 4 lines.
A1 A2 A3 B1 B2 B3 C1 C2 C3
1 0 - - - - 0 1 0
- - - 0 1 - - - -
- - - - - - - - -
1 0 - - - 0 - - -
The dash will be null(blank) in the working table. For illustration purpose, I need to put the blank in here. Otherwise, you might not be able to see it. The display might shift a little bit due to indentation.
These are what I would like to accomplish:
1. I need to average A, B, C per record by putting the results in the AVGA, AVGB and AVGC. As you see, some of the records contain totally null value. The average null value will result as blank. For example, in record # 3.
2. After I receive the result from AVGA, AVGB and AVGC, I need to average these three calculated fields into one final calculated field which is AVGABC. Some of the AVGA or AVGB might be null which should not be calculated in the final result.
I would like to design a query that will provide me the result based on the above criteria. I use a query Wizard from Access. Shall I set the property differently? I do not know much about the SQL.
Any helps toward this question will be very much appreciated. If I am not clear in this example, please e-mail me.
Thank you again for your time. Have a great Labor Day weekend.
P.S. If you recommend me to construct AVGA, AVGB, AVGC and AVGABC permanently in the table, that will be fine as well. However, I need to know how to update each record when the data entry is completed. Thank you.
I am setting up the database that contains the following fields:
A1, A2, A3, B1, B2, B3, C1, C2, and C3. All fields are set up numeric which allowed the inputs of 1, zero or null.
The A set will go together. So does the B set and the C set. I need to set up a query that will compute an average for the A set, B set and C set. So, I created three calculated fields, AVGA, AVGB and AVGC.
Remember, the null value is in there. The field is set up as numeric/byte.
These are some of my data, 4 records, 4 lines.
A1 A2 A3 B1 B2 B3 C1 C2 C3
1 0 - - - - 0 1 0
- - - 0 1 - - - -
- - - - - - - - -
1 0 - - - 0 - - -
The dash will be null(blank) in the working table. For illustration purpose, I need to put the blank in here. Otherwise, you might not be able to see it. The display might shift a little bit due to indentation.
These are what I would like to accomplish:
1. I need to average A, B, C per record by putting the results in the AVGA, AVGB and AVGC. As you see, some of the records contain totally null value. The average null value will result as blank. For example, in record # 3.
2. After I receive the result from AVGA, AVGB and AVGC, I need to average these three calculated fields into one final calculated field which is AVGABC. Some of the AVGA or AVGB might be null which should not be calculated in the final result.
I would like to design a query that will provide me the result based on the above criteria. I use a query Wizard from Access. Shall I set the property differently? I do not know much about the SQL.
Any helps toward this question will be very much appreciated. If I am not clear in this example, please e-mail me.
Thank you again for your time. Have a great Labor Day weekend.
P.S. If you recommend me to construct AVGA, AVGB, AVGC and AVGABC permanently in the table, that will be fine as well. However, I need to know how to update each record when the data entry is completed. Thank you.