M
Mick Horan
I have a table that has the following format. The first column is the field
name the second column is the sample data.
Date = 4/9/04
Unit = 1SW
Shift = NIGHT
L1 = 1
L2 = 1
L3 = 1
L4 = 1
L5 = 1
L6 = 1
L7 = 1
I need to create a query that computes some totals based on the data in each
record.
First I need to SUM the L1 to L7 fields. Using my sample data the total
would be 7. (Call it SumLtotal = 7)
Then I need to multiply each of these same L1-L7 fields times the value of
the sample data in that field against the associated number of that "L"
field. In other words L1=1, L2=2, L3=3, L4=4, L5=5, L6=6 and L7=7 . For
example L1 is 1x1=1 while L7 is 7x1=7. In this case the total would be 28.
(Call it TimesLtotal = 28)
Finally I need to divide TimesLtotal (28) by SumLtotal (7). The result
would be 4.
Can all of this be done in one query so that I can use it in a report.
Thanks, Mick
name the second column is the sample data.
Date = 4/9/04
Unit = 1SW
Shift = NIGHT
L1 = 1
L2 = 1
L3 = 1
L4 = 1
L5 = 1
L6 = 1
L7 = 1
I need to create a query that computes some totals based on the data in each
record.
First I need to SUM the L1 to L7 fields. Using my sample data the total
would be 7. (Call it SumLtotal = 7)
Then I need to multiply each of these same L1-L7 fields times the value of
the sample data in that field against the associated number of that "L"
field. In other words L1=1, L2=2, L3=3, L4=4, L5=5, L6=6 and L7=7 . For
example L1 is 1x1=1 while L7 is 7x1=7. In this case the total would be 28.
(Call it TimesLtotal = 28)
Finally I need to divide TimesLtotal (28) by SumLtotal (7). The result
would be 4.
Can all of this be done in one query so that I can use it in a report.
Thanks, Mick