count up something

s0rtd

Registered User.
Local time
Tomorrow, 08:38
Joined
Apr 16, 2003
Messages
96
hey,

I am reasonably new to all this access stuff and i have been trying to count something up for the last 2 day and have decided to ask you guys :)

i have a query which shows me:
Code:
service #            priority
20302                    3
20303                    1
20304                    3

how would i add up all the 3's and all the 1's ? ie:all priorities
what i mean is that there are 2 priority 3's and 1 priority 1.
i want to do this from within the query :)

your help would be awesome
cheers
 
Select Priority, Count(*) As CountOfPriority
From YourTable
Group By Priority;

ok sorry pat i still dont get it,
in my query i create a new field and build a new expression in it?, like this:
Code:
Count(*) and then?

the name of the priority field in the table is "prtyNumber"
sorry i have never done this before, i like access and really enjoy learning it :)
 
on the Toolbar select View > Totals. That will bring up a new row in the design and choose count from there
 
ok, this is what i have done (see attachment)

i still think i have something not quite in the right place?
i end up with a field full of 1's when i run the query

p.s thank you for all your help :) its awesome!!!
 

Attachments

  • pquery.jpg
    pquery.jpg
    24.6 KB · Views: 133
yeah i thought that could be the problem, i couldnt understand how it was going to total things up where there are only 4 priorities and the are heaps of servicerequests. :P

silly me!! at least i know for next time, i am learning more about access everyday and in huge steps :) thanks to guys like you!!

cheers
Jurgen
 
total priority from date to date

ok now that, that is all working.

How it gives me the total priorities for all calls, how do i get it to show me only the total priorities from a particular date to a date??

i have been trying to suss this out, but as soon as i get it to ask me for the dates, it shows me all data through those dates, so i end up with all the 1's again :P

what am i doing wrong?
 
I think i have to add another field to the query which has something in the criteria line, similar to this: (see attachment)
 

Attachments

  • date_query.jpg
    date_query.jpg
    15.2 KB · Views: 131
I sussed it out i just based my query on my other query which asks for the date
 
Do you wanna count the number of priority 3s in the field or do you wanna sum them up?
 

Users who are viewing this thread

Back
Top Bottom