View Full Version : Conditional Summing


Fornatian
11-19-2000, 10:27 AM
Can someone please remind how to conditionally sum one value in a record based on the value of another.

E.G. I have a subform with a Paid? Yes/No checkbox and a field holding the order line value.

What I want to do is have an unbound box showing how much is outstanding on the account.

I know the control source should be somthing like:

=Sum(if([Paid]=false,[OrderLineValue],0))

All I keep getting back is #Name error.
I can do the same task using a sum query but I know I dont need to.

Any takers...

Ian

simongallop
11-20-2000, 02:44 AM
Look at DSum

Richie
11-20-2000, 04:58 AM
Iif ([Paid]=False, Sum([Order line vale]),0)

Fornatian
11-21-2000, 09:24 AM
thanks richie,

I was being a bit slow, infact my syntax was correct i had just used the VBA 'if' not the expressioin builder 'iif'.

Thanks all

ian