Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Taking a sum of three fields

Status
Not open for further replies.

lieip

Programmer
Oct 2, 2001
12
US
I'm trying to take a sum of three fields from three different queries but when i run it it gives me an error stating that the query is too complex...what can i do?
I tried converting the 3 queries to a make table query and use the 3 fields from the the table that it produces and it works... the problem is that the table that it produces contains static data... i need the information from the orginal query which are dynamic data
 
What is the SQL statement of this Query?

How are you applying the Joins?

Paul Cooper
 
the query is this:
SELECT [BurdenDollars]+[GandA]+[Profit] AS Total
FROM (qryBurdenDollars INNER JOIN qryGandA ON (qryBurdenDollars.LaborID = qryGandA.LaborID) AND (qryBurdenDollars.TypeOfChange = qryGandA.TypeOfChange) AND (qryBurdenDollars.DeptName = qryGandA.DeptName)) INNER JOIN qryProfit ON (qryGandA.LaborID = qryProfit.LaborID) AND (qryGandA.TypeOfChange = qryProfit.TypeOfChange) AND (qryGandA.DeptName = qryProfit.DeptName);


But even without the Inner Joins:
SELECT [BurdenDollars]+[GandA]+[Profit] AS Total
FROM qryBurdenDollars, qryGandA, qryProfit;


I'm still get the error message... the problem is that Access can't make a query using 3 other different query and i'm not sure as to how i can go around this...
 
lieip in the part:

SELECT [BurdenDollars]+[GandA]+[Profit] ...

what are these fields? This should look more like:

SELECT [qryBurdenDollars]![fieldname]+[qryGandA]![fieldname]+[qryProfit]![fieldname] ...

substituting for "fieldname" the correct field you want from each of the relevant queries.

Paul Cooper
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top