Solved

# Query sum

Posted on 2011-09-17
258 Views
Experts,
My table transactions has fields labeled check amount, fees, and check type.
I need to sum all "check amount", "fees" and count the number of "check type" = H
0
Question by:Frank Freese
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 5
• 5

LVL 75

Expert Comment

ID: 36554864
Like so?

SELECT Sum(Transactions.[check amount]) AS [SumOfcheck amount], Sum(Transactions.fees) AS SumOffees
FROM Transactions
WHERE (((Transactions.[check type])="H"));

mx
0

Author Comment

ID: 36554875
I need a date parameter and count on check type = H
0

LVL 75

Accepted Solution

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 36554879
Sure:

SELECT Sum(Transactions.[check amount]) AS [SumOfcheck amount], Sum(Transactions.fees) AS SumOffees, Count(Transactions.[check type]) AS [CountOfcheck type]
FROM Transactions
WHERE (((Transactions.YourDate)=[Enter Date:]) AND ((Transactions.[check type])="H"));

mx
0

Author Comment

ID: 36554891
Didn't get anything?
0

LVL 75

Expert Comment

ID: 36554896
Are you wanting to Filter (WHERE) on Check Type = H ?

Can you show some of the table data?

mx
0

Author Comment

ID: 36554901
ok...found something. I changed YourDate to Date. Now where do I need to put the Beginning Date for my date parameter
0

Author Comment

ID: 36554903
Great - I figured it out!
0

LVL 75

Expert Comment

ID: 36554904
Date Range ... like so:

SELECT Sum(Transactions.[check amount]) AS [SumOfcheck amount], Sum(Transactions.fees) AS SumOffees, Count(Transactions.[check type]) AS [CountOfcheck type]
FROM Transactions
WHERE (((Transactions.YourDate) Between [Enter Begin Date] And [Enter End Date]) AND ((Transactions.[check type])="H"));
0

Author Closing Comment

ID: 36554905
thanks - it's been a while but once you got me started I could finish. Have a great week end mx. I do appreciate your help, as always.
0

LVL 75

Expert Comment

ID: 36554908
Always a pleasure.  You have a good one also.

mx
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
###### Suggested Courses
Course of the Month4 days, 12 hours left to enroll