jonnycattt
Registered User.
- Local time
- Today, 04:19
- Joined
- Sep 29, 2001
- Messages
- 20
Greetings all. I've been wracking my brains for a few days on this one, and I think it's time I ask the forums.
First, the data:
TABLE 1:
ArticleID Issue Edit Check ProofCheck
-----------------------------------------
7687 Jan 1 KM GW MKM
7688 Jan 1 JL GW HC
7689 Jan 1 COB HC MKM
7690 Jan 15 CA KS GJ
and so on.....
The initials in the Edit, Check, and ProofCheck columns reference another table:
Editors Table:
EdInitials(PK) IC
-------------------
GJ no
GW no
HC no
KM no
KS no
MKM no
CA yes
COB yes
JL yes
and so on...
Finally, the Issue in the first table references an "Issues" table, with data like this:
Issues table:
Issue | year
---------------------------
Jan 1 | 2002
Jan 15 | 2002
Feb 1 | 2002
Feb 15 | 2002
Mar 1 | 2002
and so on......
So, what I Need is a query that returns a count of how many articles each editor edited for all editors, and how many articles each editor checked and proofchecked (just for editors where IC is 'no'). and I need this grouped by Issue
So my result would look like this:
Issue EdInitials EditCount CkCount PrCkCount
---------------------------------------------
Jan 1 GJ 5 8 3
Jan 1 GW 3 5 9
Jan 1 KM 9 2 2
Jan 1 JL 9 NULL NULL
and so on for each issue, each editor...
JL is Null b/c he is an IC and thus would not have his initials anywhere in the Check or ProofCk columns (only in the Edit Column).
I can write 3 separate queries and get all of this information easily. What I'd like is to merge all of these queries into one query (or else join these queries) so that I'm looking at one result set and not 3.
I can't imagine why this is so hard, because it doesnt' seem like it should be. Still, I am having no luck figuring it out.
I'd appreciate any help.
Thanks.
Marc
[This message has been edited by jonnycattt (edited 02-11-2002).]
[This message has been edited by jonnycattt (edited 02-11-2002).]
First, the data:
TABLE 1:
ArticleID Issue Edit Check ProofCheck
-----------------------------------------
7687 Jan 1 KM GW MKM
7688 Jan 1 JL GW HC
7689 Jan 1 COB HC MKM
7690 Jan 15 CA KS GJ
and so on.....
The initials in the Edit, Check, and ProofCheck columns reference another table:
Editors Table:
EdInitials(PK) IC
-------------------
GJ no
GW no
HC no
KM no
KS no
MKM no
CA yes
COB yes
JL yes
and so on...
Finally, the Issue in the first table references an "Issues" table, with data like this:
Issues table:
Issue | year
---------------------------
Jan 1 | 2002
Jan 15 | 2002
Feb 1 | 2002
Feb 15 | 2002
Mar 1 | 2002
and so on......
So, what I Need is a query that returns a count of how many articles each editor edited for all editors, and how many articles each editor checked and proofchecked (just for editors where IC is 'no'). and I need this grouped by Issue
So my result would look like this:
Issue EdInitials EditCount CkCount PrCkCount
---------------------------------------------
Jan 1 GJ 5 8 3
Jan 1 GW 3 5 9
Jan 1 KM 9 2 2
Jan 1 JL 9 NULL NULL
and so on for each issue, each editor...
JL is Null b/c he is an IC and thus would not have his initials anywhere in the Check or ProofCk columns (only in the Edit Column).
I can write 3 separate queries and get all of this information easily. What I'd like is to merge all of these queries into one query (or else join these queries) so that I'm looking at one result set and not 3.
I can't imagine why this is so hard, because it doesnt' seem like it should be. Still, I am having no luck figuring it out.
I'd appreciate any help.
Thanks.
Marc
[This message has been edited by jonnycattt (edited 02-11-2002).]
[This message has been edited by jonnycattt (edited 02-11-2002).]