Solved

Query sum

Posted on 2011-09-17
10
253 Views
Last Modified: 2012-05-12
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
Comment
Question by:Frank Freese
  • 5
  • 5
10 Comments
 
LVL 75
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

by:Frank Freese
ID: 36554875
I need a date parameter and count on check type = H
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) 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

by:Frank Freese
ID: 36554891
Didn't get anything?
0
 
LVL 75
ID: 36554896
Are you wanting to Filter (WHERE) on Check Type = H ?

Can you show some of the table data?

mx
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Frank Freese
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

by:Frank Freese
ID: 36554903
Great - I figured it out!
0
 
LVL 75
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

by:Frank Freese
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
ID: 36554908
Always a pleasure.  You have a good one also.

mx
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now