Multiple Totals on Form

treva26

Registered User.
Local time
Today, 03:05
Joined
Sep 19, 2007
Messages
113
I have a form (viewed in datasheet view) with a column for the machine used and one for the time taken.

I know how to make a total box in the footer:
=Sum([Time])
that adds up all the times

but what i need is 6 boxes which add up the times for each machine
something like:
=IIf([Machine]=1,Sum([Time]))
=IIf([Machine]=2,Sum([Time]))
but obviously that doesnt work...
 
Try

=Sum(IIf(machine=1, [time], 0))

Though a subform with a totals query could prove more dynamic. Also, time is not a good name for a field, since there's also a Time() function.
 
Try

=Sum(IIf(machine=1, [time], 0))

Though a subform with a totals query could prove more dynamic. Also, time is not a good name for a field, since there's also a Time() function.


Ah, of course, at least I was close! Works like a charm, thanks.

And your point is well taken, I have chnaged the field name to TimeTaken1.

This is already a subform so I'd rather do it this way than a sub-sub-form.

Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom