T
Tom
I have a table of customers. (We have about 15,000 customers. This
table has approx 186,000 records):
tblElec_Cust_Consump_4_Andy
LocID
CustID
Year
Month
Flag
Consump
There is usually only one customer per location, but there MAY be
more, as in the case of apartment houses. There will be up to 12
records per customer per location, as I'm only interested in a one
year snapshot. (Any location won't have more than 12 records as only
one customer can be at a given location at any given time.)
I need to produce a monthly average of consumption for the year, for
each customer. Since not every customer will necessarily have 12
months of consumption, I need to count how many months a given
customer has. Next I need to add all the consumptions for those
months and divide by the number of months I came up with first.
I've created a separate table for the averages. This table has only
one record per customer, since it covers the entire one year period.
(This table has approx 22,000 records. The apartment complexes run
thru about 600 customers per month (15,000 + (600*12)=22200)):
tblElec_Cust_Consump_4_Andy_AVG
LocID
CustID
Year
Month
Nmbr of Mos
Consump Avg
I've tried:
UPDATE
tblElec_Cust_Consump_4_Andy_AVG, tblElec_Cust_Consump_4_Andy
SET
tblElec_Cust_Consump_4_Andy_AVG.[KW Months Billed] =
DCount("[tblElec_Cust_Consump_4_Andy].[KW
CMP]","tblElec_Cust_Consump_4_Andy","[KW CMP]='KW'");
Actually, I have to calc a monthly average twice. This first time is
not actually for consumption, but rather for an average "demand" (KW).
(Hence the (Flag) [KW CMP]='KW'.) Only about 600 customers have
demand. And ALL customers have consumption ((Flag) [KWH CMP]='KWH'.).
My current update query has both tables. I've tried:
Inner join - You are about to update 186928 row(s).
Left join - You are about to update 186928 row(s).
Right join - You are about to update 186928 row(s).
The left join is correct though, isn't it? This is my first time
using DCount, and apparently I just don't get it...yet. Any help you
can provide is very much appreciated...thanks in advance.
Tom
table has approx 186,000 records):
tblElec_Cust_Consump_4_Andy
LocID
CustID
Year
Month
Flag
Consump
There is usually only one customer per location, but there MAY be
more, as in the case of apartment houses. There will be up to 12
records per customer per location, as I'm only interested in a one
year snapshot. (Any location won't have more than 12 records as only
one customer can be at a given location at any given time.)
I need to produce a monthly average of consumption for the year, for
each customer. Since not every customer will necessarily have 12
months of consumption, I need to count how many months a given
customer has. Next I need to add all the consumptions for those
months and divide by the number of months I came up with first.
I've created a separate table for the averages. This table has only
one record per customer, since it covers the entire one year period.
(This table has approx 22,000 records. The apartment complexes run
thru about 600 customers per month (15,000 + (600*12)=22200)):
tblElec_Cust_Consump_4_Andy_AVG
LocID
CustID
Year
Month
Nmbr of Mos
Consump Avg
I've tried:
UPDATE
tblElec_Cust_Consump_4_Andy_AVG, tblElec_Cust_Consump_4_Andy
SET
tblElec_Cust_Consump_4_Andy_AVG.[KW Months Billed] =
DCount("[tblElec_Cust_Consump_4_Andy].[KW
CMP]","tblElec_Cust_Consump_4_Andy","[KW CMP]='KW'");
Actually, I have to calc a monthly average twice. This first time is
not actually for consumption, but rather for an average "demand" (KW).
(Hence the (Flag) [KW CMP]='KW'.) Only about 600 customers have
demand. And ALL customers have consumption ((Flag) [KWH CMP]='KWH'.).
My current update query has both tables. I've tried:
Inner join - You are about to update 186928 row(s).
Left join - You are about to update 186928 row(s).
Right join - You are about to update 186928 row(s).
The left join is correct though, isn't it? This is my first time
using DCount, and apparently I just don't get it...yet. Any help you
can provide is very much appreciated...thanks in advance.
Tom