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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
COUNT expression in a 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
|
|||
|
|||
COUNT expression in a report
Trying,
In the Control Source of an unbound textbox in the Footer or Header of the report... =Sum(IIf([Type]="Truck",1,0)) -- Steve Schapel, Microsoft Access MVP 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 |
#3
|
|||
|
|||
COUNT expression in a report
Steve
I used your expression in an unbound text box in the footer of my report. An error window poped up saying.....The expression =Sum(IIf([Type]="Truck",1,0)) is invalid. Aggregate functions are only allowed on output fields of the Record Source. Any suggestions? "Steve Schapel" wrote: Trying, In the Control Source of an unbound textbox in the Footer or Header of the report... =Sum(IIf([Type]="Truck",1,0)) -- Steve Schapel, Microsoft Access MVP 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 |
#4
|
|||
|
|||
COUNT expression in a report
Trying,
It sounds like the [Type] field is not included in the query that the form is based on. It needs to be. -- Steve Schapel, Microsoft Access MVP Trying wrote: Steve I used your expression in an unbound text box in the footer of my report. An error window poped up saying.....The expression =Sum(IIf([Type]="Truck",1,0)) is invalid. Aggregate functions are only allowed on output fields of the Record Source. Any suggestions? |
#5
|
|||
|
|||
COUNT expression in a report
On Fri, 29 Feb 2008 16:57:01 -0800, Trying wrote:
Steve I used your expression in an unbound text box in the footer of my report. An error window poped up saying.....The expression =Sum(IIf([Type]="Truck",1,0)) is invalid. Aggregate functions are only allowed on output fields of the Record Source. Any suggestions? "Steve Schapel" wrote: Trying, In the Control Source of an unbound textbox in the Footer or Header of the report... =Sum(IIf([Type]="Truck",1,0)) -- Steve Schapel, Microsoft Access MVP 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 You asked this same question a couple of days ago and received the same answer from me that Steve gave you today. If you ask the question again tomorrow you'll get the same answer you did today. Evidently the reason it's not working for you is that you left out of your message the important part about your placing this control in the footer of the report. I would suspect you placed it in the Page Footer. You cannot do calculations in the Page Footer section of a report. Place the control, with the above expression, in the detail section. Then in the Page Footer refer to that control: =[NameOfControlInDetailSection] Don't forget to not use the reserved word 'Type' as a field name. It's going to 'bite' you in the future if you do. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|