Creating a count

imright

Registered User.
Local time
Today, 01:47
Joined
Jun 27, 2008
Messages
30
This one should be easy but can't get it to do what I want. I have a query that tracks receipts from suppliers by the month. What I need to do is create a query that counts the total number of receipts by supplier per month. I've done this before but can't figure out how. :confused::confused:
 
You want a "totals" query that groups by supplier & month and counts receipts.
 
Yes, I have it set up to input the dates but I need the count of receipts by supplier per month.
 
Yes, you said that already. Does that mean you don't know how? You group by:

Format(DateField, "YYYYMM")
 
Yes, that's why I'm on this forum to learn.
I'm signing off tonight and will try this tomorrow. Thanks for the information. I'll let you know if everything works for if I have more questions.
 
I tried this but did not work probably because I'm not sure where to put it. I had my query open in Design View and put it under the date in the criteria section but got a "Data Type Mismatch" error. Removed the name Format and received a syntax error message. Tried to create an expression with this but did not work. Went into properties but couldn't see where it would go.
Sorry for being so ignorant in this but I'm just trying to learn.
 
Try

SELECT Supplier, Format(DateField, "YYYYMM") AS FormattedDate, Count(Receipts) AS HowMany
FROM TableName
GROUP BY Supplier, Format(DateField, "YYYYMM")
 

Users who are viewing this thread

Back
Top Bottom