|
Forum home »
Delegate support and help forum »
Microsoft Access Training and help » access courses in london - Count queries
access courses in london - Count queries
The UK's most regular instructor-led training courses.
Training information: access courses in london
· Microsoft.access.courses
· Microsoft Access Training uk See also
· microsoft access training
· access vba courses
· access database course Resolved · Low Priority · Version Standard
Count queries
I am familiar with COUNT queries, but I wondered if it was possible to COUNT within categories or ranges of values.
For example, I have 100 orders each of different amounts between £20 and £100 pounds.
I can easily run a COUNT query that tells me how many oders are of £20, how many of £25, etc.
Is it possible to run one query that tells me how many orders are <£30, how many are between £30 & £50, and how many between £50 and £100?
Thanks
RE: Count queries
Jonothan,
You might need to do 3 separate queries until you find a better way. Create a basic query that has criteria on the AMOUNT field, and specify your range. Once this step is done, you can then count the number of records.
You could Also use a SQL statement like this:
You need to do a query where you use the Group By statement something like follows:
SELECT tblYourTable.Question1Answer, Count(tblYourTable.Question1Answer) AS MyCount
FROM tblYourTable
GROUP BY tblYourTable.Question1Answer
ORDER BY tblYourTable.Question1Answer;
tblYourTable = The name of your table.
Question1Answer = The name of the field with your answers in it.
This is one of the most powerful SQL abilities of course, but a lot of people forget that you can put a count() of in the SELECT statement to get the number of occurrences.
|