Column Headings Trouble

  • Thread starter Thread starter mase
  • Start date Start date
M

mase

Guest
TRANSFORM Sum(Query1.SumOfTNXQTY_15) AS SumOfSumOfTNXQTY_15
SELECT Query1.PRTNUM_15, Sum(Query1.SumOfTNXQTY_15) AS [Total Of SumOfTNXQTY_15]
FROM Query1
GROUP BY Query1.PRTNUM_15
PIVOT Query1.[TNXDTE_15 By Month];

I have created a cross tab query (shown above) to show the table below. Is it possible to put the months in chronological order rather than alphabetical. I have tried the column heading property but I think I’m doing something wrong as it won’t work.

Could anyone offer any advice or perhaps even the coding to carry this out?

Thanks

Mase
 
begin with a parameter query on your table(s) where you put your data together and distinguish the year. There is no need to do any grouping there. You have to explicitly declare the parameter(s).
Code:
PARAMETERS [Please enter desired year] Short;
SELECT
  TNXDTE
, PRTNUM
, NTXQTY
FROM TNX
WHERE Year(TNXDTE)=[Please enter desired year]
Then build a crosstab with the wizzard. For the date field you should use month as grouping period. The In Clause is responsible for creating fixed column headings.
Code:
TRANSFORM Sum(NTXQTY)
SELECT
  PRTNUM
FROM ThePreviousQuery
GROUP BY PRTNUM
PIVOT Format(TNXDTE,"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
 

Users who are viewing this thread

Back
Top Bottom