Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sum in a query

Posted on 2014-01-27
4
Medium Priority
?
337 Views
Last Modified: 2014-01-28
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!
0
Comment
Question by:cansevin
[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
4 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39813167
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
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 39813211
Seems you would want:


BookedTrue: Abs(Sum([Booked))

and a WHERE clause of

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

mx
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 39813215
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
 
LVL 31

Expert Comment

by:hnasr
ID: 39813842
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

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

618 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