View Single Post
  #5 (permalink)  
Old July 2nd, 2009, 08:22 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,516, Level: 42
Points: 9,516, Level: 42 Points: 9,516, Level: 42 Points: 9,516, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,060
Thanks: 0
Thanked 10 Times in 10 Posts
Default

If this were on a report, which I am assuming, then I would do this:

Put a text box on the report header or footer, then put this code in the text box:

Code:
=Sum(IIf([Deviation]<0,[Deviation],0))
What this does is Sum the Deviation values if they are less than 0, else it sums a zero.

So for this data:

Text Deviation
Row1 -1
Row2 -2
Row3 -5
Row4 6
Row5 7

The textbox returns -8.

Is that what you want?
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com

Last edited by mmcdonal : July 2nd, 2009 at 08:23 AM. Reason: add mark up
Reply With Quote