Obviously I am trying to do this in a report.
I am trying to get a total # of times where the following occurance happens.
[pres] = 'inc' Or 'com' Or 'int'
I tried the following and it worked:
=Abs(Sum([pres]="com"))
When I added the other results as follows it did not calculate properly:
=Abs(Sum([pres]="com" Or "inc" Or "int"))
Another question I have is if I wanted to get the sum of [pres] where it is
not null?
fredg - 31 May 2006 00:48 GMT
> Obviously I am trying to do this in a report.
> I am trying to get a total # of times where the following occurance happens.
[quoted text clipped - 8 lines]
> Another question I have is if I wanted to get the sum of [pres] where it is
> not null?
Ques 1):
=Sum(IIf([pres]="com",1,IIf([Pres] = "inc",1,IIf([Pres] =
"int",1,0))))
Ques 2):
=Sum(Nz([Pres]))

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
John Spencer - 31 May 2006 00:56 GMT
=Abs(Sum([pres]="com" Or [pres]="inc" Or [pres]="int"))
=Abs(Sum(IsNull([pres])=False))
=Abs(Sum([pres] Is Not Null))
> Obviously I am trying to do this in a report.
> I am trying to get a total # of times where the following occurance happens.
[quoted text clipped - 8 lines]
> Another question I have is if I wanted to get the sum of [pres] where it is
> not null?
Marshall Barton - 31 May 2006 02:38 GMT
[snip main question]
>> Another question I have is if I wanted to get the sum of [pres] where it is
>> not null?
=Count(pres)

Signature
Marsh
MVP [MS Access]
John Spencer - 31 May 2006 13:17 GMT
DUH!!! Forehead slap! Of course.
I got locked into a method and just kept going. I try to avoid
preconceptions when developing a solution, but sometimes ...
Thanks for the correction.
> [snip main question]
>>> Another question I have is if I wanted to get the sum of [pres] where it
>>> is
>>> not null?
>
> =Count(pres)
Marshall Barton - 31 May 2006 15:44 GMT
Good advice John, but make those head slaps gentle ones. My
forehead is dented from too many hard head slaps ;-)
--
Marsh
>DUH!!! Forehead slap! Of course.
>
[quoted text clipped - 4 lines]
>
>> =Count(pres)
>> [snip main question]
>>>> Another question I have is if I wanted to get the sum of
>>>> [pres] where it is not null?