I
Ian Baker
I have a crosstab query that sums all the Account Payable entries per
Category per month and is as follows:
TRANSFORM Sum([Subtotal]+[Tax]) AS Total
SELECT qryAccountPayableItem.CategoryID
FROM Setup, [Account Payable] INNER JOIN qryAccountPayableItem ON [Account
Payable].AccountPayableID = qryAccountPayableItem.AccountPayableID
WHERE ((([Account Payable].AuthorisedDate)>[YearStart] Or ([Account
Payable].AuthorisedDate) Is Not Null))
GROUP BY qryAccountPayableItem.CategoryID
PIVOT Month([AuthorisedDate]) In (1,2,3,4,5,6,7,8,9,10,11,12)
WITH OWNERACCESS OPTION;
Currently the above query has column headings for each month of the year
from 1 to 12. One of the tables in the query is called Setup which has a
field called [YearStart] that contains a date that the financial year
starts. What I am trying to do (without success to date) is to get the
columns to start at the month of the {YearStart] field and go for 12 months.
i.e. If YearStart=1/6/04 then I need the columns to be
6,7,8,9,10,11,12,1,2,3,4,5
Any help is greatly appreciated
Regards
Ian
Category per month and is as follows:
TRANSFORM Sum([Subtotal]+[Tax]) AS Total
SELECT qryAccountPayableItem.CategoryID
FROM Setup, [Account Payable] INNER JOIN qryAccountPayableItem ON [Account
Payable].AccountPayableID = qryAccountPayableItem.AccountPayableID
WHERE ((([Account Payable].AuthorisedDate)>[YearStart] Or ([Account
Payable].AuthorisedDate) Is Not Null))
GROUP BY qryAccountPayableItem.CategoryID
PIVOT Month([AuthorisedDate]) In (1,2,3,4,5,6,7,8,9,10,11,12)
WITH OWNERACCESS OPTION;
Currently the above query has column headings for each month of the year
from 1 to 12. One of the tables in the query is called Setup which has a
field called [YearStart] that contains a date that the financial year
starts. What I am trying to do (without success to date) is to get the
columns to start at the month of the {YearStart] field and go for 12 months.
i.e. If YearStart=1/6/04 then I need the columns to be
6,7,8,9,10,11,12,1,2,3,4,5
Any help is greatly appreciated
Regards
Ian