Adding numbers from Different Tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to add two fields togeather from different tables that and
display the records which the total of the two fields are less than 130.
When I so the query on the main table I get the records, as soon as I link
the table to the other table to get the other field, I get no records at all.
Please help!
 
SELECT CALL_COUNT_SUMMARY_BY_ISR.supervisor,
CALL_COUNT_SUMMARY_BY_ISR.supervisorName, CALL_COUNT_SUMMARY_BY_ISR.salesman,
CALL_COUNT_SUMMARY_BY_ISR.salesmanName, CALL_COUNT_SUMMARY_BY_ISR.scheduled,
CALL_COUNT_SUMMARY_BY_ISR.scheduledProductiveAssignedISR,
CALL_COUNT_SUMMARY_BY_ISR.scheduledProductiveOtherISR,
CALL_COUNT_SUMMARY_BY_ISR.scheduledProductiveCSR,
CALL_COUNT_SUMMARY_BY_ISR.scheduledUnproductive,
CALL_COUNT_SUMMARY_BY_ISR.scheduledRemaining,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod1,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod2,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod3,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod4,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod5,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriodOther,
CALL_COUNT_SUMMARY_BY_ISR.isrProductiveAssignedRoutes,
CALL_COUNT_SUMMARY_BY_ISR.isrProductiveOtherRoutes,
CALL_COUNT_SUMMARY_BY_ISR.isrUnproductiveAllRoutes
FROM CALL_AllocationCHG INNER JOIN CALL_COUNT_SUMMARY_BY_ISR ON
CALL_AllocationCHG.[NEW_S#] = CALL_COUNT_SUMMARY_BY_ISR.salesman
WHERE
(((CALL_COUNT_SUMMARY_BY_ISR.scheduled)=([call_count_summary_by_isr].[scheduled]+[CALL_AllocationCHG].[New_Allo_No])));
 
I am trying to add two fields togeather from different tables that and
display the records which the total of the two fields are less than 130.
When I so the query on the main table I get the records, as soon as I link
the table to the other table to get the other field, I get no records at all.
Please help!

How are you linking the tables? Do you have a common field which
uniquely identifies which record in the first table should be linked
to which record in the second?

John W. Vinson[MVP]
 
change your where clause to ..

where
sum([call_count_summary_by_isr].[scheduled]+[CALL_AllocationCHG].[New_Allo_N
o]) <130;

Richard Davis said:
SELECT CALL_COUNT_SUMMARY_BY_ISR.supervisor,
CALL_COUNT_SUMMARY_BY_ISR.supervisorName, CALL_COUNT_SUMMARY_BY_ISR.salesman,
CALL_COUNT_SUMMARY_BY_ISR.salesmanName,
CALL_COUNT_SUMMARY_BY_ISR.scheduled,
CALL_COUNT_SUMMARY_BY_ISR.scheduledProductiveAssignedISR,
CALL_COUNT_SUMMARY_BY_ISR.scheduledProductiveOtherISR,
CALL_COUNT_SUMMARY_BY_ISR.scheduledProductiveCSR,
CALL_COUNT_SUMMARY_BY_ISR.scheduledUnproductive,
CALL_COUNT_SUMMARY_BY_ISR.scheduledRemaining,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod1,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod2,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod3,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod4,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriod5,
CALL_COUNT_SUMMARY_BY_ISR.remainingPeriodOther,
CALL_COUNT_SUMMARY_BY_ISR.isrProductiveAssignedRoutes,
CALL_COUNT_SUMMARY_BY_ISR.isrProductiveOtherRoutes,
CALL_COUNT_SUMMARY_BY_ISR.isrUnproductiveAllRoutes
FROM CALL_AllocationCHG INNER JOIN CALL_COUNT_SUMMARY_BY_ISR ON
CALL_AllocationCHG.[NEW_S#] = CALL_COUNT_SUMMARY_BY_ISR.salesman
WHERE
(((CALL_COUNT_SUMMARY_BY_ISR.scheduled)=([call_count_summary_by_isr].[schedu
led]+[CALL_AllocationCHG].[New_Allo_No])));


Denis Dougall said:
Show us your SQL, please.

Denis
at
all.
 
Back
Top