View Full Version : Using Multiple Criteria with DSum


MrsGorilla
04-30-2004, 09:04 AM
I have this total I'm trying to calculate in the footer of a report I'm working on and I can't get it to work right. This is what I have:

Me.Text114 = DSum("[MLDDT]", "PCTRET", "[MAILING] = '1ST' AND [TYPE] = 'NOTICE'")

So far, I haven't gotten any error messages, but it doesn't return any totals either. Can anyone point out to me the error of my ways?

I appreciate the help. I haven't used the DSum function much so I'm not sure if I'm doing something wrong or not.

Rich
04-30-2004, 09:57 AM
Are these records in the report?

MrsGorilla
04-30-2004, 10:07 AM
Yes, I have columns in both the table and the report for all of those fields. I can't figure out why it won't work because I've used DSum in a similar report with success, although it had only one criteria specified. However, that shouldn't matter should it? :confused:

Rich
04-30-2004, 10:10 AM
Then Sum(Iif......... is a better option. Do these records contain numeric values or do you just want to count how many times they appear?

MrsGorilla
04-30-2004, 10:17 AM
The field MLDDT actually has a number in it, a count for records mailed on a certain day. The other fields, MAILING and TYPE, have text in them. What they are wanting me to do is sum all of the records in MLDDT for which MAILING = 1ST AND TYPE = NOTICE, regardless of the day mailed. Hope I'm making this clear.

Any help you can give would be appreciated.

MrsGorilla
04-30-2004, 11:11 AM
Hmmm. I think I may have figured out a solution to this one all by myself. :)

Which is amazing considering how I've been feeling lately with my impending due date. Thanks for your help Rich.