Examples of IIf expressions that use Abs for abolute values?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access 2000 SR-1 Professional: Need > info on IIf expressions to reflect an
absolute # (Abs). Only example in Help?: Abs(number). In my database report,
I want: If the Sub-Total is negative (less than zero), then
Abs([Quantitiy]*[Amount]), or ([Quantity]*[Amount])*[Discount]). Taken
separately, they work for that portion of the equation, however, if I put
them together, it only gives me the equation with *[Discount]). I've tried
several combinations of >= or <= and reversed the expression string--to no
avail. The negative # represents a discount credit, needed to tally in
discounts & to calculate lost tax on the discount. This is where the Abs
should come in. I can't find any examples to help me. Can someone assist?
 
Hi.
Here are some samples I got from a previous post.
To count:
=Sum(Abs([Your Condition]))
To sum a field like Qty:
=Sum(Abs([Your Condition]) * [Qty])
You can also use multiple conditions:
=Sum(Abs([Gender]="M" And [DOB] < #1/1/1960#) * [Wages])
Try:
=Sum(Abs([Gender]="M"))
=Sum(Abs([Gender]="M" OR[Gender]="F"))
As far as your application:
=Sum(Abs([Sub-Total]<0)*[Quantity]*Amount]*[Discount])
Hope this helps.
Fons
 
Back
Top