sum

G

Guest

On a report, in a text box, I'm trying to count the True results..
TR_EXPEDITED is a check box on the form, so the query shows "0" or "1"
obviously.
But when I code the text box in the report to count them with either "0"/"1"
or "True/False" I get an error "mismatch in criteria expression"..

=Sum(Abs([TR_Expedited]='True'))

Suggestions????
 
B

BruceM

Try removing the quotes from around the word True. The same thing would
apply to 0 or -1.
 
G

Guest

First, the value of VBA constant True is -1. False is 0
They are a boolean data type, so only -1 and 0 are allowed.

Second, you would not put the True or False in quotes. That turns it into a
string value, so you are trying to compare a numeric data type to a string
data type.

All you need is:
=Sum(Abs([TR_Expedited]))
 

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