M
Martin Prunty
I’m trying to build an application that analyzes up to ten (10) tables that
contain information about unique types of telephone calls that are received
in half-hour increments throughout the day. Each table contains the same
information about calls (and identical fields) including how many calls are
received of each type every half-hour, the average length of calls in
seconds, etc. For each table, I have also created a query that performs
certain calculations on each table.
I’ve built another query that combines each of the other queries and
performs some additional calculations on them. When I have data in all ten
tables, the application works as designed.
When I have data in less than ten (10) tables, the last query doesn’t run
because I haven’t been able to figure out how to include a null statement in
case 1 or more of the other ten queries is empty. My question is “What do I
need to change in the SQL code to ignore any one of the ten queries if some
of the ten (10) tables are empty?â€
Following is the SQL code in its current form for the query in question.
Thank you in advance for your assistance.
Martin
SELECT [Skill01 Query].RecordID, [Skill01 Query].CallDate, [Skill01
Query].Department, [Skill01 Query].Skill, [Skill01 Query].Interval, [Skill01
Query]![IncCalls]+[Skill02Query]![IncCalls]+[Skill03Query]![IncCalls]+[Skill04Query]![IncCalls]+[Skill05Query]![IncCalls]+[Skill06Query]![IncCalls]+[Skill07Query]![IncCalls]+[Skill08Query]![IncCalls]+[Skill10Query]![IncCalls]
AS CombinedCalls, [Skill01
Query]![ICallLoad]+[Skill02Query]![ICallLoad]+[Skill03Query]![ICallLoad]+[Skill04Query]![ICallLoad]+[Skill05Query]![ICallLoad]+[Skill06Query]![ICallLoad]+[Skill07Query]![ICallLoad]+[Skill08Query]![ICallLoad]+[Skill09Query]![ICallLoad]+[Skill10Query]![ICallLoad]
AS ILoad, [Skill01
Query]![OCallLoad]+[Skill02Query]![OCallLoad]+[Skill03Query]![OCallLoad]+[Skill04Query]![OCallLoad]+[Skill05Query]![OCallLoad]+[Skill06Query]![OCallLoad]+[Skill07Query]![OCallLoad]+[Skill08Query]![OCallLoad]+[Skill09Query]![OCallLoad]+[Skill10Query]![OCallLoad]
AS OLoad, [Skill01
Query]![SeatedAgents]+[Skill02Query]![SeatedAgents]+[Skill03Query]![SeatedAgents]+[Skill04Query]![SeatedAgents]+[Skill05Query]![SeatedAgents]+[Skill06Query]![SeatedAgents]+[Skill07Query]![SeatedAgents]+[Skill08Query]![SeatedAgents]+[Skill09Query]![SeatedAgents]+[Skill10Query]![SeatedAgents]
AS SeatedAgents,
Agents([SLO]![ServiceLevelPercent],[SLO]![ServiceTime],[CombinedCalls]*2,([ILoad]+[OLoad])/[CombinedCalls]) AS CombinedAgents
FROM SLO, (((((((([Skill01 Query] INNER JOIN Skill02Query ON [Skill01
Query].RecordID = Skill02Query.RecordID) INNER JOIN Skill03Query ON
Skill02Query.RecordID = Skill03Query.RecordID) INNER JOIN Skill04Query ON
Skill03Query.RecordID = Skill04Query.RecordID) INNER JOIN Skill05Query ON
Skill04Query.RecordID = Skill05Query.RecordID) INNER JOIN Skill06Query ON
Skill05Query.RecordID = Skill06Query.RecordID) INNER JOIN Skill07Query ON
Skill06Query.RecordID = Skill07Query.RecordID) INNER JOIN Skill08Query ON
Skill07Query.RecordID = Skill08Query.RecordID) INNER JOIN Skill09Query ON
Skill08Query.RecordID = Skill09Query.RecordID) INNER JOIN Skill10Query ON
Skill09Query.RecordID = Skill10Query.RecordID;
contain information about unique types of telephone calls that are received
in half-hour increments throughout the day. Each table contains the same
information about calls (and identical fields) including how many calls are
received of each type every half-hour, the average length of calls in
seconds, etc. For each table, I have also created a query that performs
certain calculations on each table.
I’ve built another query that combines each of the other queries and
performs some additional calculations on them. When I have data in all ten
tables, the application works as designed.
When I have data in less than ten (10) tables, the last query doesn’t run
because I haven’t been able to figure out how to include a null statement in
case 1 or more of the other ten queries is empty. My question is “What do I
need to change in the SQL code to ignore any one of the ten queries if some
of the ten (10) tables are empty?â€
Following is the SQL code in its current form for the query in question.
Thank you in advance for your assistance.
Martin
SELECT [Skill01 Query].RecordID, [Skill01 Query].CallDate, [Skill01
Query].Department, [Skill01 Query].Skill, [Skill01 Query].Interval, [Skill01
Query]![IncCalls]+[Skill02Query]![IncCalls]+[Skill03Query]![IncCalls]+[Skill04Query]![IncCalls]+[Skill05Query]![IncCalls]+[Skill06Query]![IncCalls]+[Skill07Query]![IncCalls]+[Skill08Query]![IncCalls]+[Skill10Query]![IncCalls]
AS CombinedCalls, [Skill01
Query]![ICallLoad]+[Skill02Query]![ICallLoad]+[Skill03Query]![ICallLoad]+[Skill04Query]![ICallLoad]+[Skill05Query]![ICallLoad]+[Skill06Query]![ICallLoad]+[Skill07Query]![ICallLoad]+[Skill08Query]![ICallLoad]+[Skill09Query]![ICallLoad]+[Skill10Query]![ICallLoad]
AS ILoad, [Skill01
Query]![OCallLoad]+[Skill02Query]![OCallLoad]+[Skill03Query]![OCallLoad]+[Skill04Query]![OCallLoad]+[Skill05Query]![OCallLoad]+[Skill06Query]![OCallLoad]+[Skill07Query]![OCallLoad]+[Skill08Query]![OCallLoad]+[Skill09Query]![OCallLoad]+[Skill10Query]![OCallLoad]
AS OLoad, [Skill01
Query]![SeatedAgents]+[Skill02Query]![SeatedAgents]+[Skill03Query]![SeatedAgents]+[Skill04Query]![SeatedAgents]+[Skill05Query]![SeatedAgents]+[Skill06Query]![SeatedAgents]+[Skill07Query]![SeatedAgents]+[Skill08Query]![SeatedAgents]+[Skill09Query]![SeatedAgents]+[Skill10Query]![SeatedAgents]
AS SeatedAgents,
Agents([SLO]![ServiceLevelPercent],[SLO]![ServiceTime],[CombinedCalls]*2,([ILoad]+[OLoad])/[CombinedCalls]) AS CombinedAgents
FROM SLO, (((((((([Skill01 Query] INNER JOIN Skill02Query ON [Skill01
Query].RecordID = Skill02Query.RecordID) INNER JOIN Skill03Query ON
Skill02Query.RecordID = Skill03Query.RecordID) INNER JOIN Skill04Query ON
Skill03Query.RecordID = Skill04Query.RecordID) INNER JOIN Skill05Query ON
Skill04Query.RecordID = Skill05Query.RecordID) INNER JOIN Skill06Query ON
Skill05Query.RecordID = Skill06Query.RecordID) INNER JOIN Skill07Query ON
Skill06Query.RecordID = Skill07Query.RecordID) INNER JOIN Skill08Query ON
Skill07Query.RecordID = Skill08Query.RecordID) INNER JOIN Skill09Query ON
Skill08Query.RecordID = Skill09Query.RecordID) INNER JOIN Skill10Query ON
Skill09Query.RecordID = Skill10Query.RecordID;