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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Count" expression in report



 
 
Thread Tools Display Modes
  #1  
Old February 27th, 2008, 06:31 PM posted to microsoft.public.access
Trying
external usenet poster
 
Posts: 49
Default "Count" expression in report

Hi
I have a field, named [Type].
In a report, what is the expression to count this field “[Type]” where
Type=Truck
??? =Count([Type]) where type = “Truck”
Thanks

  #2  
Old February 27th, 2008, 06:45 PM posted to microsoft.public.access
fredg
external usenet poster
 
Posts: 4,386
Default "Count" expression in report

On Wed, 27 Feb 2008 09:31:04 -0800, Trying wrote:

Hi
I have a field, named [Type].
In a report, what is the expression to count this field [Type] where
Type=Truck
??? =Count([Type]) where type = Truck
Thanks


I would strongly suggest that you not use the word 'Type' as a field
name. Type is a reserved Access keyword and refers to an Access Field
property. For more information see:
http://www.allenbrowne.com/Ap****ueBadWord.html

To answer your question....
=Sum(IIf([TypeField] = "Truck",1,0)
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




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 09:40 PM.


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