Hi all
Ran into a brick wall with the following cross tab query.
TRANSFORM Sum([Top 5 Unpaid by Month].[AMT]) AS SumOfAMT
SELECT [Top 5 Unpaid by Month].[VENDOR_NAME], [Top 5 Unpaid by Month].[INVOICE_NUM], [Top 5 Unpaid by Month].[INVOICE_DATE]
FROM [Top 5 Unpaid by Month], MonthConv
GROUP BY [Top 5 Unpaid by Month].[VENDOR_NAME], [Top 5 Unpaid by Month].[INVOICE_NUM], [Top 5 Unpaid by Month].[INVOICE_DATE]
PIVOT [Top 5 Unpaid by Month].ACCT_MONTH;
The query the cross tab is being based off of is the following
SELECT Ledger.VENDOR_NAME, Ledger.INVOICE_NUM, Ledger.INVOICE_DATE, Ledger.AMT, Ledger.ACCT_MONTH, Ledger.ID
FROM Ledger
WHERE (((Ledger.AMT) In (SELECT TOP 5 Sum(T1.AMT) AS AMT
FROM Ledger AS T1
WHERE ((([Ledger].[ACCT_MONTH])=[T1].[ACCT_MONTH]) AND ((T1.ACCT_Year)=2011) AND ((T1.STATUS)="UNPAID"))
GROUP BY [Ledger].[ACCT_MONTH], T1.VENDOR_NAME, T1.INVOICE_NUM, T1.INVOICE_DATE, T1.ACCT_Year, T1.STATUS
ORDER BY Sum(T1.AMT) DESC)));
When i run it I get the message the microsoft office access database engine does not recognize [Ledger].[ACCT_MONTH] as a valid field name or experession.
I am stumped since it am selecting data from a query and not the based table anymore so why is this coming up. I been surfing the web and common theme is the need for parameters for Crosstab queries being explicitly defined. Everyone does a [Form]![blah].[blah] but this is nota form and I do not want promting. I just want to take the existing query and cross tab it. When I tried doing it in one fell swoop Access balks at the fact taht i have a criteria on the value term in the cross tab.
Any way around this would be much appreacited. Thanks in advance.
Ran into a brick wall with the following cross tab query.
TRANSFORM Sum([Top 5 Unpaid by Month].[AMT]) AS SumOfAMT
SELECT [Top 5 Unpaid by Month].[VENDOR_NAME], [Top 5 Unpaid by Month].[INVOICE_NUM], [Top 5 Unpaid by Month].[INVOICE_DATE]
FROM [Top 5 Unpaid by Month], MonthConv
GROUP BY [Top 5 Unpaid by Month].[VENDOR_NAME], [Top 5 Unpaid by Month].[INVOICE_NUM], [Top 5 Unpaid by Month].[INVOICE_DATE]
PIVOT [Top 5 Unpaid by Month].ACCT_MONTH;
The query the cross tab is being based off of is the following
SELECT Ledger.VENDOR_NAME, Ledger.INVOICE_NUM, Ledger.INVOICE_DATE, Ledger.AMT, Ledger.ACCT_MONTH, Ledger.ID
FROM Ledger
WHERE (((Ledger.AMT) In (SELECT TOP 5 Sum(T1.AMT) AS AMT
FROM Ledger AS T1
WHERE ((([Ledger].[ACCT_MONTH])=[T1].[ACCT_MONTH]) AND ((T1.ACCT_Year)=2011) AND ((T1.STATUS)="UNPAID"))
GROUP BY [Ledger].[ACCT_MONTH], T1.VENDOR_NAME, T1.INVOICE_NUM, T1.INVOICE_DATE, T1.ACCT_Year, T1.STATUS
ORDER BY Sum(T1.AMT) DESC)));
When i run it I get the message the microsoft office access database engine does not recognize [Ledger].[ACCT_MONTH] as a valid field name or experession.
I am stumped since it am selecting data from a query and not the based table anymore so why is this coming up. I been surfing the web and common theme is the need for parameters for Crosstab queries being explicitly defined. Everyone does a [Form]![blah].[blah] but this is nota form and I do not want promting. I just want to take the existing query and cross tab it. When I tried doing it in one fell swoop Access balks at the fact taht i have a criteria on the value term in the cross tab.
Any way around this would be much appreacited. Thanks in advance.