Can I Do this?

  • Thread starter Thread starter S Jackson
  • Start date Start date
S

S Jackson

I am trying to get a report to give me the sum of a field on an "IF"
condition:

All records have an [Amt] field.
All records have a [DispositionType] field.
I want the report to give me a sum of the [Amt] field for every record where
[DispositionType] = "Other"
I put in an unbound control in the report footer but I can't get it to give
me the right total. This expression produces a blank result:

=IIf(([DispositionType]="Other"),Sum([Amt]))

Any thoughts?
S. Jackson
 
S Jackson said:
I am trying to get a report to give me the sum of a field on an "IF"
condition:

All records have an [Amt] field.
All records have a [DispositionType] field.
I want the report to give me a sum of the [Amt] field for every record where
[DispositionType] = "Other"
I put in an unbound control in the report footer but I can't get it to give
me the right total. This expression produces a blank result:

=IIf(([DispositionType]="Other"),Sum([Amt]))

Try...

=Sum(IIf([DispositionType]="Other", [Amt], 0))
 
Thanks! It worked. If statements confused the h*** outta me! And thanks
for the quick response!

S. Jackson

Rick Brandt said:
S Jackson said:
I am trying to get a report to give me the sum of a field on an "IF"
condition:

All records have an [Amt] field.
All records have a [DispositionType] field.
I want the report to give me a sum of the [Amt] field for every record where
[DispositionType] = "Other"
I put in an unbound control in the report footer but I can't get it to give
me the right total. This expression produces a blank result:

=IIf(([DispositionType]="Other"),Sum([Amt]))

Try...

=Sum(IIf([DispositionType]="Other", [Amt], 0))
 
Back
Top