Group By Query - Sum

T

TechTutors

Hello All,

I am trying get a sum by using a group by query. However, the query is not
handling any negative numbers I have in the fields.

For instance Record 1 = $200; Record 2 = $300; Record 3 = ($50)

.... The sum I'm recieving is $500.. NOT $450

Is there anything I can do to remedy this problem?

Many Thanks!
 
R

raskew via AccessMonster.com

Hi -

Try identifying negative numbers as -50 rather than (50).
Example from the debug window:

record1 = 200
Record2 = 300
Record3 = -50
? record1 + record2 + record3
450

HTH - Bob
 
M

Michel Walsh

You may have a WHERE clause that exclude the negative value; the negative 50
may be from a different GROUP value (mainly if the values are strings,
sometimes, an extra blank character, or an 0 instead of an O, 1 and I and l
, ... can occur and produce a different group).

You can cut (from the SQL view) and paste here the SQL statement ?


Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

wish there was a CountDistinct() function 6
Sum of a Count 4
SUM in a UNION query 2
Query Question 3
Simple Question on Addition 3
Need Help With SQL Query 2
Top 3 per group 3
Group By Desing View 4

Top