B
bscott
I'm sure there is a simple solution to this, but being fairly new to Access I
would appreciate some assistance...
I have a query that joins two tables. One table has call details for each day
that an agent works. The other table has details for each call that is graded
for each agent. However, calls can be graded on days that the agent does not
work. When joining the tables, the query will only display calls graded on
dates that the agent works.
This is what I would like to do to correct this: If there was a call graded
on a day that the agent did not work, this data be rolled up to the last day
that they did work.
Current SQL:
SELECT tbl_ScorecardStep1.row_date, tbl_ScorecardStep1.Agent, Count
(tbl_Monitors_ScorecardStep3.SumOfTPE) AS CountOfSumOfTPE, Count
(tbl_Monitors_ScorecardStep3.SumOfTPP) AS CountOfSumOfTPP
FROM tbl_ScorecardStep1 LEFT JOIN tbl_Monitors_ScorecardStep3 ON
(tbl_ScorecardStep1.RID = tbl_Monitors_ScorecardStep3.RID) AND
(tbl_ScorecardStep1.row_date = tbl_Monitors_ScorecardStep3.EVALDATE)
GROUP BY tbl_ScorecardStep1.row_date, tbl_ScorecardStep1.Agent;
Example of tbl_ScorecardStep1:
row_date Agent RID
5/3/2010 Frapples, Bob 26152
5/4/2010 Frapples, Bob 26152
5/13/2010 Frapples, Bob 26152
Example of tbl_Monitors_ScorecardStep3:
EVALDATE RID SumOfTPE SumOfTPP
5/3/2010 26152 91 100
5/7/2010 26152 76 100
5/12/2010 26152 147 200
Current result:
row_date Agent SumOfSumOfTPE SumOfSumOfTPP
5/3/2010 Frapples, Bob 91 100
5/4/2010 Frapples, Bob
5/13/2010 Frapples, Bob
Desired result (5/1 and 5/12 monitor data is rolled up to the last day that
the agent worked:
row_date Agent SumOfSumOfTPE SumOfSumOfTPP
5/3/2010 Frapples, Bob 91 100
5/4/2010 Frapples, Bob 223 300
5/13/2010 Frapples, Bob
Any help pointing me in the right direction is greatly appreciated!
would appreciate some assistance...
I have a query that joins two tables. One table has call details for each day
that an agent works. The other table has details for each call that is graded
for each agent. However, calls can be graded on days that the agent does not
work. When joining the tables, the query will only display calls graded on
dates that the agent works.
This is what I would like to do to correct this: If there was a call graded
on a day that the agent did not work, this data be rolled up to the last day
that they did work.
Current SQL:
SELECT tbl_ScorecardStep1.row_date, tbl_ScorecardStep1.Agent, Count
(tbl_Monitors_ScorecardStep3.SumOfTPE) AS CountOfSumOfTPE, Count
(tbl_Monitors_ScorecardStep3.SumOfTPP) AS CountOfSumOfTPP
FROM tbl_ScorecardStep1 LEFT JOIN tbl_Monitors_ScorecardStep3 ON
(tbl_ScorecardStep1.RID = tbl_Monitors_ScorecardStep3.RID) AND
(tbl_ScorecardStep1.row_date = tbl_Monitors_ScorecardStep3.EVALDATE)
GROUP BY tbl_ScorecardStep1.row_date, tbl_ScorecardStep1.Agent;
Example of tbl_ScorecardStep1:
row_date Agent RID
5/3/2010 Frapples, Bob 26152
5/4/2010 Frapples, Bob 26152
5/13/2010 Frapples, Bob 26152
Example of tbl_Monitors_ScorecardStep3:
EVALDATE RID SumOfTPE SumOfTPP
5/3/2010 26152 91 100
5/7/2010 26152 76 100
5/12/2010 26152 147 200
Current result:
row_date Agent SumOfSumOfTPE SumOfSumOfTPP
5/3/2010 Frapples, Bob 91 100
5/4/2010 Frapples, Bob
5/13/2010 Frapples, Bob
Desired result (5/1 and 5/12 monitor data is rolled up to the last day that
the agent worked:
row_date Agent SumOfSumOfTPE SumOfSumOfTPP
5/3/2010 Frapples, Bob 91 100
5/4/2010 Frapples, Bob 223 300
5/13/2010 Frapples, Bob
Any help pointing me in the right direction is greatly appreciated!