Sum filtered criteria

  • Thread starter Thread starter D B Lawson
  • Start date Start date
D

D B Lawson

Guest
I have an unbound field with:

=Sum(Nz([WEstHours]*[WRate],0))

Can I add another criteria where it only sums records that aren't marked as deleted (by a check box)?

Thanks
 
Something like this, maybe:
=Sum(Nz(Iif(myDelFlag=vbYes,0,[WEstHours])*[WRate],0))
 
Does marking them as deleted mean they're not actually deleted?
 
Hi Rich, yes, marking them as deleted means they aren't actually deleted. It's an estimate form for work to be carried out and there could be amendments to the original estimate but we still want to see what the original estimate was and it shows the reason for the amendment to the original estimate submitted. I therefore have a deleted box which the user ticks if the work is no longer required, it then doesn't appear on the print out. I have, however, a calculated unbound field which keeps a running sum of the estimate total and, obviously, I don't want deleted items to be included in the running sum. We don't want to completely delete items because the customer might come back and decide to go with the original estimate!

[This message has been edited by D B Lawson (edited 08-28-2001).]
 
Hi Chris

Just thought I'd let you know that:

=Sum(Nz(IIf([WDeleted]=-1,0,[WEstHours])*[WRate],0))

Worked for me.

Thanks very much for your help.

Dawn
 

Users who are viewing this thread

Back
Top Bottom