>I'm trying to create a formula in the report footer that will calculate
>values greater than 12. For example, if a value is 12 or less I don't want to
>calculate it, if the value is greater than 12 I want to multiply the amount
>greater than 12 by 5.5 (if 16 then 5.5 X 4). Your help is appreciated.
Try an expression like:
=IIf(thevalue > 12, 5.5 * (thevalue - 12), thevalue)

Signature
Marsh
MVP [MS Access]
BarryC - 15 Mar 2005 19:05 GMT
Marshall,
I tried that formula. I have one record with a value of 16. I should get 22
as the sum (16-12=4*5.5). With the IIF statement Im getting 12?
> >I'm trying to create a formula in the report footer that will calculate
> >values greater than 12. For example, if a value is 12 or less I don't want to
[quoted text clipped - 4 lines]
>
> =IIf(thevalue > 12, 5.5 * (thevalue - 12), thevalue)
Marshall Barton - 15 Mar 2005 22:18 GMT
I don't see how that's possible using the expression I
posted. Could you Copy/Paste the text box's ControlSource
property into a reply so I can see **exactly** what you
have.

Signature
Marsh
MVP [MS Access]
>I tried that formula. I have one record with a value of 16. I should get 22
>as the sum (16-12=4*5.5). With the IIF statement Im getting 12?
[quoted text clipped - 7 lines]
>>
>> =IIf(thevalue > 12, 5.5 * (thevalue - 12), thevalue)
BarryC - 15 Mar 2005 22:59 GMT
Marshall,
I ended up changing the sql statement on the report and summed the text box.
Thanks for your help.
> I don't see how that's possible using the expression I
> posted. Could you Copy/Paste the text box's ControlSource
[quoted text clipped - 11 lines]
> >>
> >> =IIf(thevalue > 12, 5.5 * (thevalue - 12), thevalue)
Marshall Barton - 16 Mar 2005 00:00 GMT
Sum?? Where did a Sum come into the question? If that's
was what you were tring to do all along, you should have
said so.
Maybe the latest issue is that you were trying to Sum a text
box. This will never work because the aggregate functions
only know how to operate on fields in the RecordSource
table/query. Moving the expression to the query is a godd
way to resolve the issue. The other is to use a text box
that Sums the expression, not a text box with the
expression.

Signature
Marsh
MVP [MS Access]
>I ended up changing the sql statement on the report and summed the text box.
>Thanks for your help.
[quoted text clipped - 15 lines]
>> >>
>> >> =IIf(thevalue > 12, 5.5 * (thevalue - 12), thevalue)