Sum data under special condition

S

SF

Hi,

I have a main and detail subform. In the subform I had a Check field (Yes/No
field) from the under laying table. I am having a problem of putting a
sum(amount) on the main form for only item that has a check in the Yes/No
filed.


Could someone advice?

I have Access 2003 on XP box.

SF
 
B

Baz

A Yes/No field has a numeric value of zero when it is "No", and -1 when it
is "Yes". So, to achieve what you want, simply multiply the amount by the
Yes/No field, and by -1 e.g.

Sum(amount * yesnofield * -1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Form calculation from a subform 2
refresh information 1
Access Daily Entry with multiple entries per field 0
Conditional Sum 4
Double click 8
populate to all rows in the subform 4
Requery to update data 6
Subform Subtotal 1

Top