?
Solved

How to Sum a Subquery?

Posted on 2005-03-11
2
Medium Priority
?
800 Views
Last Modified: 2008-03-06
I can't seem to sum a subquery where i have some calculated fields in the query itself:

SELECT Count([Payments data].[Job ref]) AS [CountOfJob ref], Sum([Payments data].Comm) AS Commission, Sum([Comm]*0.175) AS VAT, Sum([Comm]+[VAT]) AS Total
FROM [Payments data];

Is this easy to do?

Thanks
lapchien
0
Comment
Question by:Lapchien
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Expert Comment

by:puranik_p
ID: 13514954
SELECT Count([Payments data].[Job ref]) AS [CountOfJob ref], Sum([Payments data].Comm) AS Commission, Sum([Comm])*0.175 AS VAT, Sum([Comm])+sum([VAT]) AS Total
FROM [Payments data];
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 2000 total points
ID: 13515254
Try:

SELECT Count([Payments data].[Job ref]) AS [CountOfJob ref], Sum([Payments data].Comm) AS Commission, Sum([Comm]*0.175) AS VAT, Sum([Comm]+[Comm]*0.175) AS Total
FROM [Payments data];

Nic;o)
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question