hi everybody, here is my problem, thanks in advance for reading.
I have three queries, second is based in the results of first, and third is based on second results.
the first one selects a bounch of records based in a field in the form ([forms]![Mainsplash].[Country]):
query 1 - SQL:
SELECT IDExp.FY, IDExp.FYM.Value, IDExp.FYC, IDExp.Type, dataExp.Cost_category, dataExp.Order_no, dataExp.Long_desc, dataExp.Group_amount, dataExp.Local_amount
FROM IDExp INNER JOIN dataExp ON IDExp.ID = dataExp.IDExp
WHERE (((IDExp.FYC)=[forms]![Mainsplash].[Country]) AND ((IDExp.Type)="ASPIRE"));
the second one is a crosstab and based on the results of first presents data with months in rows.
query 2 - SQL:
PARAMETERS [forms]![mainsplash].[country] Text ( 255 );
TRANSFORM Sum(CQS_Aspire2.Group_amount) AS SumOfGroup_amount
SELECT CQS_Aspire2.Cost_category, CQS_Aspire2.Long_desc, CQS_Aspire2.Order_no, Sum(CQS_Aspire2.Group_amount) AS [Total Of Group_amount]
FROM CQS_Aspire2
GROUP BY CQS_Aspire2.Cost_category, CQS_Aspire2.Long_desc, CQS_Aspire2.Order_no
PIVOT CQS_Aspire2.IDExp.FYM.Value;
Finally I did a third query in order to have the same results of the second one but with some calculated fields...
query 3 - SQL:
PARAMETERS [forms]![mainsplash].[country] Text ( 255 );
SELECT CQS_Aspire2_Crosstab.CQS_Aspire2.Cost_category, CQS_Aspire2_Crosstab.CQS_Aspire2.Long_desc, CQS_Aspire2_Crosstab.CQS_Aspire2.Order_no, CQS_Aspire2_Crosstab.November, CQS_Aspire2_Crosstab.December, CQS_Aspire2_Crosstab.January, [November]+[December]+[January] AS Expr1, CQS_Aspire2_Crosstab.February, CQS_Aspire2_Crosstab.March, CQS_Aspire2_Crosstab.April, [February]+[March]+[April] AS Expr2, CQS_Aspire2_Crosstab.May, CQS_Aspire2_Crosstab.June, CQS_Aspire2_Crosstab.July, [May]+[June]+[July] AS Expr3, CQS_Aspire2_Crosstab.August, CQS_Aspire2_Crosstab.September, CQS_Aspire2_Crosstab.October, [August]+[September]+[October] AS Expr4
FROM CQS_Aspire2_Crosstab;
And here is where is my problem, despite of the fact that first and second works fine, third one launches the error:
"The microsoft office access database engine does not recognize 'forms!mainsplash.country' as a valid field name or expression"
notice that I was having the same mistake for second query before I added "forms!mainsplash.country" as a parameter.
thank you very much.
I have three queries, second is based in the results of first, and third is based on second results.
the first one selects a bounch of records based in a field in the form ([forms]![Mainsplash].[Country]):
query 1 - SQL:
SELECT IDExp.FY, IDExp.FYM.Value, IDExp.FYC, IDExp.Type, dataExp.Cost_category, dataExp.Order_no, dataExp.Long_desc, dataExp.Group_amount, dataExp.Local_amount
FROM IDExp INNER JOIN dataExp ON IDExp.ID = dataExp.IDExp
WHERE (((IDExp.FYC)=[forms]![Mainsplash].[Country]) AND ((IDExp.Type)="ASPIRE"));
the second one is a crosstab and based on the results of first presents data with months in rows.
query 2 - SQL:
PARAMETERS [forms]![mainsplash].[country] Text ( 255 );
TRANSFORM Sum(CQS_Aspire2.Group_amount) AS SumOfGroup_amount
SELECT CQS_Aspire2.Cost_category, CQS_Aspire2.Long_desc, CQS_Aspire2.Order_no, Sum(CQS_Aspire2.Group_amount) AS [Total Of Group_amount]
FROM CQS_Aspire2
GROUP BY CQS_Aspire2.Cost_category, CQS_Aspire2.Long_desc, CQS_Aspire2.Order_no
PIVOT CQS_Aspire2.IDExp.FYM.Value;
Finally I did a third query in order to have the same results of the second one but with some calculated fields...
query 3 - SQL:
PARAMETERS [forms]![mainsplash].[country] Text ( 255 );
SELECT CQS_Aspire2_Crosstab.CQS_Aspire2.Cost_category, CQS_Aspire2_Crosstab.CQS_Aspire2.Long_desc, CQS_Aspire2_Crosstab.CQS_Aspire2.Order_no, CQS_Aspire2_Crosstab.November, CQS_Aspire2_Crosstab.December, CQS_Aspire2_Crosstab.January, [November]+[December]+[January] AS Expr1, CQS_Aspire2_Crosstab.February, CQS_Aspire2_Crosstab.March, CQS_Aspire2_Crosstab.April, [February]+[March]+[April] AS Expr2, CQS_Aspire2_Crosstab.May, CQS_Aspire2_Crosstab.June, CQS_Aspire2_Crosstab.July, [May]+[June]+[July] AS Expr3, CQS_Aspire2_Crosstab.August, CQS_Aspire2_Crosstab.September, CQS_Aspire2_Crosstab.October, [August]+[September]+[October] AS Expr4
FROM CQS_Aspire2_Crosstab;
And here is where is my problem, despite of the fact that first and second works fine, third one launches the error:
"The microsoft office access database engine does not recognize 'forms!mainsplash.country' as a valid field name or expression"
notice that I was having the same mistake for second query before I added "forms!mainsplash.country" as a parameter.
thank you very much.