Carlosdl
29820 pts. | Apr 1 2009 11:21PM GMT
Is Fundno a string ?
Could you try this SQL (with the same VBA code you posted): ?
SELECT B.Owner, Sum(B.AvLand) AS SumOfAvLand, Sum(B.AvImpv) AS SumOfAvImpv, Sum(A.TaxAmt1) AS SumOfTaxAmt1, Sum(A.TaxAmt2) AS SumOfTaxAmt2, Sum(A.Unpaid1) AS SumOfUnpaid1, Count(A.Napn) AS CountOfNapn
FROM [Solano Delinquency 2009] AS A INNER JOIN [Solano Roll 2008] AS B
ON A.Napn=B.Napn
GROUP BY B.Owner;
When you say “doesn’t work”, do you get some error message ? or a prompt asking for a parameter ?
On the other hand, I’m not an access expert, so I don’t really know how Access manage these dynamic ‘where’ clauses, but if it executes the base query first, and then apply the dynamic ‘where’ condition, it is possible that you can only filter by columns included in your select list, so, I would also try this:
SELECT B.Owner, A.Fundno,Sum(B.AvLand) AS SumOfAvLand, Sum(B.AvImpv) AS SumOfAvImpv, Sum(A.TaxAmt1) AS SumOfTaxAmt1, Sum(A.TaxAmt2) AS SumOfTaxAmt2, Sum(A.Unpaid1) AS SumOfUnpaid1, Count(A.Napn) AS CountOfNapn
FROM [Solano Delinquency 2009] AS A INNER JOIN [Solano Roll 2008] AS B
ON A.Napn=B.Napn
GROUP BY B.Owner,A.Fundno;
Regards,
Pubfin
15 pts. | Apr 1 2009 11:38PM GMT
A.Fundno is a string.
The second one worked! Thank you! I am going to hang this in big bold letters on my cube:
“you can only filter by columns included in your select list”






