I am trying to write a query that will return the records in my table based on the date, or set of dates I enter. In this query, I am trying to count the number of records where the process type = 1, and then count the records where the process type = 2, and then count the records where the process type = 3.
I am not sure how to do this well, and so have been monkeying around with a union query, just to get started.
Here is the query I wrote so far, and when I try to add any other fields to the query, I get an error about the item is not used in an aggregate function. Can someone help me?
The table is just an entry table that stores sorter statistics based on process type and date.
Thanks in advance.
Nick
I am not sure how to do this well, and so have been monkeying around with a union query, just to get started.
Here is the query I wrote so far, and when I try to add any other fields to the query, I get an error about the item is not used in an aggregate function. Can someone help me?
Code:
select count(*) from tblEntries as Type1
where [ProcessType] = "1"
union
select count(*) from tblEntries as Type2
where [ProcessType] = "2"
UNION select count(*) from tblEntries as Type3
where [ProcessType] = "3";
The table is just an entry table that stores sorter statistics based on process type and date.
Thanks in advance.
Nick