Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Column Headings in Crosstab Query 1

Status
Not open for further replies.

gRegulator

Technical User
Jul 3, 2003
133
CA
Hi,

I have created a crosstab query which shows ethnicity as Column header and Disposition as Row Header. It works fine. My only problem is that the ethnicity values are taken from a lookup wizard, so instead of showing up as Aboriginal, Inuit, Other. They show up as 1,2,3. I would like to change the column headings if possible to show the actual meanings, not just the numbers. Here is my code for the query:

Code:
PARAMETERS [Forms]![frm_dateparameter_q29]![txtStart] DateTime, [Forms]![frm_dateparameter_q29]![txtEnd] DateTime;
TRANSFORM Count(qry_union_q29_ethnicity_disposition.Start) AS CountOfStart
SELECT qry_union_q29_ethnicity_disposition.ConditionDescription, Count(qry_union_q29_ethnicity_disposition.Start) AS [Total Offenders]
FROM qry_union_q29_ethnicity_disposition
WHERE (((qry_union_q29_ethnicity_disposition.Start) Between [Forms]![frm_dateparameter_q29]![txtStart] And [Forms]![frm_dateparameter_q29]![txtEnd]))
GROUP BY qry_union_q29_ethnicity_disposition.ConditionDescription
PIVOT qry_union_q29_ethnicity_disposition.Ethnicity;

Is this possible? Thanks!
 
Then you need to have the description field from your lookup table in the query:
qry_union_q29_ethnicity_disposition
Using the field which looks up to the lookup table is not good enough. You just end up with the problem you are seeing here.
 
Lupins,

Thanks so much, that was alot easier than I had thought it would be!

Worked great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top