Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Calulating totals from various tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-21 : 14:40:20
Hilton writes "I am stumped! I have a table with branch info for different branches in a co. Each branch has employees, stored in another table. The employees all generate variable costs as well as commissions, stored in two further tables, and have a basic desk cost split amongst all branch employees per branch evenly, stored in another table. I am trying to run a query that will return the branch desk cost, commission, and variable cost totals using the "sum" command, but the results of one table are being multiplied depending on how many records there are in one of the other tables!!



for example, if branch A has two employees, who have generated 3 commissions totalling $1000, but lots of costs, totalling eg $5000, then the query is returning $5000 correctly, but $1000 as eg $3500. The query uses multiple "Sum" commands and right joins. it is is Access, but it is the SQL which is incorrect, not the DBMS. what can i do???"

   

- Advertisement -