Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum of Negative Values

Status
Not open for further replies.

RJL1

Technical User
Oct 3, 2002
228
US
I have a report with a field called fldBalance. This field is beign caluculated at the query by subtracting the cases in stock from the required stock level. This results in positive and negative values. I woud like to add (Sum) just the negative values so I know overall how many cases I need to tag to bring my stock up to level. My problem is that my report is adding up all the positive values and subtracting the negative ones.

The result is beign calculated in a report footer.


Thanks for any help

RJL
 
try, sum(iif(fldVal<0), fldVal, 0)

--------------------
Procrastinate Now!
 
Thanks,

I could not get it to twork but I work at it a this is my solution. I duplicated ny qury and set the criteria of the fldBalance to <0. I then used the Dsum to get the total of my second query which was only negative values. It is not the most elegant solution but it works.

Thanks any way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top