I have created a crosstab query, and it works ok.
I have the following:
Targets: which is an area the reps need to address
Notes: Which are notes for the targets
Source: which are the reps ID numbers
asource1: which is the paper report the rep completes
The code for the query is: [blue]
TRANSFORM Count([rep logs].asource1) AS CountOfasource11
SELECT Targets.Targets, Targets.Notes, Count([rep logs].asource1) AS CountOfasource1
FROM Targets RIGHT JOIN [rep logs] ON Targets.Targets = [rep logs].Targets
GROUP BY Targets.Targets, Targets.Notes
PIVOT [rep logs].Source In (45732,45733,45734,45735,45736,45737,45738,45739,45740);
[/blue]
I have a list of 160 Target areas, but the above only brings me back those targets that have a value in for the source. I want to produce a report which shows those targets that have a value against a rep and those that do not have a value.
On the last line of the code I have put in a few reps source codes, but again I have about 100 of these, but what I would like is only those between a certain number range if that is possible, i.e 45730 - 45750. without having to put in each number as a column heading.
Another little tester, when the report is produced, and it shows me the target on the left column, and the notes in the next column, then the total number of recorded tries (asource1), then a break down of the selected rep fields with each rep showing the number of tries, so it looks something like
[red]
Targets | Notes | Countofasource1 | 45730 | 45731 |
games | test | 30 | 3 | 14 |
etc.
[/red]
After this I want to be able to show from this query how many sources have filed notes on their targets, but not just the amount.
From the above example this would be 2 sources, have filed notes, but I still want the number of notes to be displayed in the results, the score 2 will need to be in a separate column.
I know there is a lot in this query but nay help is apreciated.
I have the following:
Targets: which is an area the reps need to address
Notes: Which are notes for the targets
Source: which are the reps ID numbers
asource1: which is the paper report the rep completes
The code for the query is: [blue]
TRANSFORM Count([rep logs].asource1) AS CountOfasource11
SELECT Targets.Targets, Targets.Notes, Count([rep logs].asource1) AS CountOfasource1
FROM Targets RIGHT JOIN [rep logs] ON Targets.Targets = [rep logs].Targets
GROUP BY Targets.Targets, Targets.Notes
PIVOT [rep logs].Source In (45732,45733,45734,45735,45736,45737,45738,45739,45740);
[/blue]
I have a list of 160 Target areas, but the above only brings me back those targets that have a value in for the source. I want to produce a report which shows those targets that have a value against a rep and those that do not have a value.
On the last line of the code I have put in a few reps source codes, but again I have about 100 of these, but what I would like is only those between a certain number range if that is possible, i.e 45730 - 45750. without having to put in each number as a column heading.
Another little tester, when the report is produced, and it shows me the target on the left column, and the notes in the next column, then the total number of recorded tries (asource1), then a break down of the selected rep fields with each rep showing the number of tries, so it looks something like
[red]
Targets | Notes | Countofasource1 | 45730 | 45731 |
games | test | 30 | 3 | 14 |
etc.
[/red]
After this I want to be able to show from this query how many sources have filed notes on their targets, but not just the amount.
From the above example this would be 2 sources, have filed notes, but I still want the number of notes to be displayed in the results, the score 2 will need to be in a separate column.
I know there is a lot in this query but nay help is apreciated.