A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

sum



 
 
Thread Tools Display Modes
  #1  
Old May 15th, 2007, 02:54 PM posted to microsoft.public.access.reports
Dan @BCBS
external usenet poster
 
Posts: 195
Default sum

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????
  #2  
Old May 15th, 2007, 03:35 PM posted to microsoft.public.access.reports
BruceM
external usenet poster
 
Posts: 723
Default sum

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

"Dan @BCBS" wrote in message
...
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????



  #3  
Old May 15th, 2007, 03:37 PM posted to microsoft.public.access.reports
Klatuu
external usenet poster
 
Posts: 7,074
Default sum

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]))

--
Dave Hargis, Microsoft Access MVP


"Dan @BCBS" wrote:

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????

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.