Full Version: query not summing when pulling from multiple queries
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
TashiraRonin
I have a query which pulls data from 1 other table and 3 queries
The information from the tables and queries work fine but the code line where it should sum the three queries it does not
I have bolded the bit that doesn't work.

Should this be a seperate query?


SELECT [Application Title and Key].[Application Assigned Number], [Costs Total Evaluator].SumOfCosts AS [Total Evaluator Costs], [Costs Total AP].[Total AP Fees] AS [Total AP Costs], [Costs Total MSAC].[MSAC Costs per Assessment] AS [Total MSAC Costs], Sum([SumOfCosts]+[Total AP Fees]+[MSAC Costs per Assessment]) AS [TOTAL Costs per Assessment], [Application Title and Key].Evaluator, [Application Title and Key].[Assessment Type]
FROM (([Application Title and Key] LEFT JOIN [Costs Total MSAC] ON [Application Title and Key].[Application Assigned Number] = [Costs Total MSAC].[Assessment number]) LEFT JOIN [Costs Total AP] ON [Application Title and Key].[Application Assigned Number] = [Costs Total AP].[Assessment number]) LEFT JOIN [Costs Total Evaluator] ON [Application Title and Key].[Application Assigned Number] = [Costs Total Evaluator].[Assessment number]
GROUP BY [Application Title and Key].[Application Assigned Number], [Costs Total Evaluator].SumOfCosts, [Costs Total AP].[Total AP Fees], [Costs Total MSAC].[MSAC Costs per Assessment], [Application Title and Key].Evaluator, [Application Title and Key].[Assessment Type];
MicroE
Try using the Nz function to convert nulls to zeros:

Sum(nz([SumOfCosts],0)+nz([Total AP Fees],0)+nz([MSAC Costs per Assessment],0))
TashiraRonin
Brilliant!
MicroE
Glad I could assist.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.