DSUM??

G

GD

I want to create a new field with a query, and sum the records in an existing
field, based on the criteria of another field.

In other words, let's say I have an Invoice# field and an InvAmt field. How
do I create a 3rd field in a query that totals all InvAmts for each instance
that a specific Invoice# appears in the Invoice# field?

Would it be a DSUM? Or just a SUM? I know that it's SUMIF as an Excel
formula, but I don't see that in Access. Is there an equivalent?

Thanks for your time!!
 
G

GD

Thanks, Ken! Can you give me the exact expression? I've tried many
variations with no luck.
 
K

Ken Snell \(MVP\)

Can you be specific about the data/fields? Your first post suggests that the
expression might be this:

=DSum("InvAmt", "NameOfTheTable", "[Invoice#]=" & [Invoice#])

The above assumes that you have a field or control named Invoice# on your
form and that that field/control contains the invoice number of interest,
and that that field/control is a numeric field.
 

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

Top