Group By Query - Sum

  • Thread starter Thread starter TechTutors
  • Start date Start date
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!
 
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
 
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
 
Back
Top