[nateobot]
Registered User.
- Local time
- Today, 00:25
- Joined
- Jul 15, 2002
- Messages
- 64
OK I have a big table. It has a few fields but that is not the problem. This big table links with another table on two fields (2 fields on the big table (TableA) can link with one field on TableB.
I know not smart (I did not design and am not allowed to change this fact).
So TableA can join with TableB through
1. A.CompID = B.CompID
2. A.LegacyID = B.CompID
3. A.CompID and A.LegacyID = B.CompID (yes compid and legacyid can be the same)
The problem comes in that I need to do reporting on only 4 fields. These four fields need to have distinct counts done. Thus I need a distinct count of compid & legacyID's for each month.
I have gotten around the whole messiness by creating 3 tables.
1. All CompID are equal
2. All LegacyID are equal
3. Both CompID and LegacyID are equal.
What I need is a crosstab query or something like that to compile the total counts.
Right now my crosstab query looks something like this:
So what I will need to do is add the Legacy Counts + the CompID counts and subtract the Counts from the table that has both fields.
I don't know if I can do this in one crosstab, export to excel and let excel do the math or what.
I hope this makes some sort of sense. If you need more info or anything let me know
Thanks
I know not smart (I did not design and am not allowed to change this fact).
So TableA can join with TableB through
1. A.CompID = B.CompID
2. A.LegacyID = B.CompID
3. A.CompID and A.LegacyID = B.CompID (yes compid and legacyid can be the same)
The problem comes in that I need to do reporting on only 4 fields. These four fields need to have distinct counts done. Thus I need a distinct count of compid & legacyID's for each month.
I have gotten around the whole messiness by creating 3 tables.
1. All CompID are equal
2. All LegacyID are equal
3. Both CompID and LegacyID are equal.
What I need is a crosstab query or something like that to compile the total counts.
Right now my crosstab query looks something like this:
Code:
ChangeMonth Type1 Type2 Type3
200201 126 94 890
200202 99 79 1092
200203 133 91 1501
200204 177 179 1843
200205 177 143 2140
200206 116 95 1078
So what I will need to do is add the Legacy Counts + the CompID counts and subtract the Counts from the table that has both fields.
I don't know if I can do this in one crosstab, export to excel and let excel do the math or what.
I hope this makes some sort of sense. If you need more info or anything let me know
Thanks