subquery expression HELP!

  • Thread starter Thread starter BFish
  • Start date Start date
B

BFish

Any help will be appreciated.

I'm trying to get MTD invoice totals for different categories of invoices.
I'm very much having a problem incorpating the CodingID (CodingID = the 4
categories numeriacly) for the table into this statement for filtering.

MTD Gross Prft %: ((DSum("InvoiceSale","tblInvoices","DatePart('m', [Date])="
& [AMonth] & " And DatePart('yyyy',[Date])<=" & [AYear] & ""))-(DSum
("InvoiceCost","tblInvoices","DatePart('m', [Date])=" & [AMonth] & " And
DatePart('yyyy',[Date])<=" & [AYear] & "")))/(DSum("InvoiceSale",
"tblInvoices","DatePart('m', [Date])=" & [AMonth] & " And DatePart('yyyy',
[Date])<=" & [AYear] & ""))

As can be seen I'm getting a total of all invoices in gross profit format for
the date requirement filter. I believe a And function is needed, but have
limited experience with expressions. I did try to create a new field with
the CodingID and where clause, but of course to no avail.

Any help would be great and thanks in advance.

Bill
 
I like to do seperate queries for things, then link them together into
another query. This allows for simplified debugging and maintenance. What
you have there is almost impossible to read, understand, and specify what to
change.
 

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

DSum criteria 1
Running Totals in a query Microsoft article 290136 2
DSum Funktion isn`t working 1
Running total in query 2
Running Total 10
DSUM, Running total problem 8
Filtering by Month 1
Dailly Running Totals 6

Back
Top