Sum Producing Negative Numbers

G

Guest

I have a query that counts the number of checked boxes. It totals the
correct number of checked boxes, but the numbers are negative. I've tried
changing the format, etc.
Here is an example.

Room Total Meeting Supported UnSupported Duration
R100 2 -1 -1 8:00
R450 1 -1 0 10:30
 
B

Brian Bastl

Beyuduzz,

You could do this a variety of ways. Here are two:

Sum([SomeField]) * -1
Sum(Abs([SomeField]))

HTH,
Brian
 
G

Guest

If you are summing then it is doing it correct. Checkboxes store a check
mark as a minus one - sum of minuses is a negative number. You can make it a
positive number by using the ABS function.
 
G

Guest

Thanks. That worked. So what exactly am I doing by replacing what I had with
this?
--
I''m a novice with an advance way of thinking.


Brian Bastl said:
Beyuduzz,

You could do this a variety of ways. Here are two:

Sum([SomeField]) * -1
Sum(Abs([SomeField]))

HTH,
Brian

Beyuduzz said:
I have a query that counts the number of checked boxes. It totals the
correct number of checked boxes, but the numbers are negative. I've tried
changing the format, etc.
Here is an example.

Room Total Meeting Supported UnSupported Duration
R100 2 -1 -1 8:00
R450 1 -1 0 10:30
 
G

Guest

The ABS function is the ABSolute value of a number. It just strips off the
sign of the value.

You could multiply your negative total by -1 and get the same results.
 
G

Guest

Ok. Karl, I have another one for you.

As in my previous post, I have a duration. The only way to get it to appear
in a time format is to change the Format in the Design view of the query to
Short Time. A standard number returns a funky decimal number. like the
example below. It should read 6.0 for 6 hours. Also when this query is
exported to excel the duration column can't be summed. It returnes 0. I want
to export this data into Excel and create a chart with it.

MeetingDate TimeID SetupTime StartTime EndTime Duration{hhmm}
5/19/2006 MDA 6:00 6:30 12:00 0.25
 
G

Guest

A standard number returns a funky decimal number.
Access uses that funky decimal number to indicate part of a day. Your 6
hour span equals 0.25 which is a quarter of a day. Excel does the same thing
- just set the cell format to time.
 

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

Top