A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Totals Query



 
 
Thread Tools Display Modes
  #1  
Old June 27th, 2008, 04:14 PM posted to microsoft.public.access.queries
Erika
external usenet poster
 
Posts: 249
Default Totals Query

I have a table where I enter the following info

Permit# Issue Date Cost State
1234 05/08/08 40.00 WI
1235 05/09/08 40.00 WI

How do I set up a query that I can enter a start date and and end date and
it will give me the total count of the Permit# and the total costs for WI
within the date range. I am getting totals but it is grouping them by state
and then listing them for each day and I just want the following if searched
between 05/01/08 and 05/10/08

Permit count Cost State
2 80.00 WI
  #2  
Old June 27th, 2008, 04:26 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default Totals Query

SELECT COUNT(*) AS premitCount, SUM(Costs) AS totalCost, state
FROM yourTableName
WHERE [Issued Date] Between [frist date to consider] AND [last date to
consider]
GROUP BY state



Vanderghast, Access MVP



"Erika" wrote in message
...
I have a table where I enter the following info

Permit# Issue Date Cost State
1234 05/08/08 40.00 WI
1235 05/09/08 40.00 WI

How do I set up a query that I can enter a start date and and end date and
it will give me the total count of the Permit# and the total costs for WI
within the date range. I am getting totals but it is grouping them by
state
and then listing them for each day and I just want the following if
searched
between 05/01/08 and 05/10/08

Permit count Cost State
2 80.00 WI



  #3  
Old June 27th, 2008, 06:25 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Totals Query

In design view (the query grid0, change GROUP BY to WHERE under the Issue Date
field.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

Michel Walsh wrote:
SELECT COUNT(*) AS premitCount, SUM(Costs) AS totalCost, state
FROM yourTableName
WHERE [Issued Date] Between [frist date to consider] AND [last date to
consider]
GROUP BY state



Vanderghast, Access MVP



"Erika" wrote in message
...
I have a table where I enter the following info

Permit# Issue Date Cost State
1234 05/08/08 40.00 WI
1235 05/09/08 40.00 WI

How do I set up a query that I can enter a start date and and end date and
it will give me the total count of the Permit# and the total costs for WI
within the date range. I am getting totals but it is grouping them by
state
and then listing them for each day and I just want the following if
searched
between 05/01/08 and 05/10/08

Permit count Cost State
2 80.00 WI



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:05 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.