Totals Query

  • Thread starter Thread starter Erika
  • Start date Start date
E

Erika

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
 
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
 
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 said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

last price query 2
Date Groups 1
Query help! 1
Extracting from Crosstab query 2
Difference by Min & Max Date 3
How to add line numbers to groups within a query? 2
SQL Statement 6
Query Join Problem 9

Back
Top