Solved

Query sum

Posted on 2011-09-17
10
255 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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
 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

773 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