M
Mathew
Hi all ...
I would like to create a crosstab query that groups scores
into categories if possible based on the results of a
query.
a sample of my table layout is below:
ID# Date Max
15151 01/01/2002 97
15150 01/15/2002 12
15149 01/31/2002 27
15148 02/07/2002 56
15147 02/07/2002 68
Below is my SQL:
TRANSFORM Count(myquery.id) AS CountOfid
SELECT Format([date],"mmmyy") AS [Month], Count
(myquery.id) AS [Total Of ID]
FROM myquery
GROUP BY Format([date],"mmmyy"), Year([date]), Month
([date])
ORDER BY Year([date]), Month([date])
PIVOT myquery.Max;
15151 01/01/2002 97
15150 01/15/2002 12
15149 01/31/2002 27
15148 02/07/2002 56
15147 02/07/2002 68
What I get is:
Month |12|27|56|68|97|
Jan02 |1 |1 | | |1 |
Feb02 | | | 1| 1| |
What I would like to get is:
Month |<50 |50-95 |>100
Jan02 | 2 | | 1
Feb02 | | 2 |
Any Help would be appreciated
Thanks
Mathew
I would like to create a crosstab query that groups scores
into categories if possible based on the results of a
query.
a sample of my table layout is below:
ID# Date Max
15151 01/01/2002 97
15150 01/15/2002 12
15149 01/31/2002 27
15148 02/07/2002 56
15147 02/07/2002 68
Below is my SQL:
TRANSFORM Count(myquery.id) AS CountOfid
SELECT Format([date],"mmmyy") AS [Month], Count
(myquery.id) AS [Total Of ID]
FROM myquery
GROUP BY Format([date],"mmmyy"), Year([date]), Month
([date])
ORDER BY Year([date]), Month([date])
PIVOT myquery.Max;
15151 01/01/2002 97
15150 01/15/2002 12
15149 01/31/2002 27
15148 02/07/2002 56
15147 02/07/2002 68
What I get is:
Month |12|27|56|68|97|
Jan02 |1 |1 | | |1 |
Feb02 | | | 1| 1| |
What I would like to get is:
Month |<50 |50-95 |>100
Jan02 | 2 | | 1
Feb02 | | 2 |
Any Help would be appreciated
Thanks
Mathew