Sum in a query

I am having trouble running a sum in a query for one particular column. The "count" works fine, it just won't sum. I'm guessing it isn't reading it as a number properly, correct?

How can I fix the problem? It comes from a query that runs an expression that is:

BookedTrue: Abs(Sum([Booked]=True And [RecordedMessage]=[qryWhosComputer]![Last]))

It is that value that isn't properly allowing me to sum. Thanks!
cansevinAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
Seems you would want:


BookedTrue: Abs(Sum([Booked))

and a WHERE clause of

WHERE  [RecordedMessage]=[qryWhosComputer]![Last]

mx
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you please explain what you want to "sum" ?

SUM( <expression> ) is only for the expression returning numbers.
your expression is a boolean expression which will return only true or false.

please clarify
0
 
Helen FeddemaCommented:
Generally speaking, with Boolean fields, what you need is a count of the True values (or maybe of the False values, depending on your needs).
0
 
hnasrCommented:
In this case sum works as count, because it sums abs(-1)s or 0s.
The expression returns a Boolean value, -1 or 0.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.