crosstab - sort columns on column value

  • Thread starter Thread starter Paul S
  • Start date Start date
P

Paul S

Cardiac ENT Ob/Gyn Peds
2003 23% 24% 25% 26%
2002 21% 22% 22% 25%
2001 19% 21% 22% 24%

Above is example output from a join between a top 4 query (from year 2003)
and an all data query.
We want the columns to present in descending order of the value in 2003.
Peds 1st, Ob/Gyn 2nd, ENT 3rd, etc. How can we accomplish this?
 
I think you would need to calculate the values in a simple totals query.
Then open a recordset based on the query so you can step through the records
and build your SQL of the crosstab. Specifying the IN (...) at the end of
the crosstab sql will determine the order of the columns.
 
Back
Top