here's my sql code:
[CODE=sql]SELECT ActivityLog.Dat eSignedIN, Sum(ActivityLog .ProductPurchas ed) AS SumOfProductPur chased, Sum(ActivityLog .ProductAdj) AS SumOfProductAdj , Sum(ActivityLog .TaxPercent) AS SumOfTaxPercent , Sum(ActivityLog .Subtotal) AS SumOfSubtotal, Sum(ActivityLog .GrandTotal) AS SumOfGrandTotal , Sum(ActivityLog .TransactionTyp e) AS SumOfTransactio nType, Sum(Round((((([ProductPurchase d] + Nz([ProductAdj],0))*([TaxPercent]*2)) + (([Subtotal]-([ProductPurchase d] + Nz([ProductAdj],0)))*[TaxPercent]) + [Subtotal])+Nz([Shipping],0))+0.000001,2 )) AS ExpectedGrandTo tal, Sum(Round(Nz([GrandTotal],[ExpectedGrandTo tal]),2)) AS FinalGT, Sum(ActivityLog .Shipping) AS SumOfShipping, Sum(Round((([TaxPercent]*([Subtotal] - ([ProductPurchase d] + Nz([ProductAdj],0)))) + (2*([ProductPurchase d] + Nz([ProductAdj],0))*[TaxPercent]) + 0.00000001),2)) AS ExpectedTax, Sum(ActivityLog .ActualTax) AS SumOfActualTax, Sum(Round(Nz([ActualTax],[ExpectedTax]),2)) AS FinalTax, Sum([subtotal]-[productpurchase d]) AS Supplies
FROM ActivityLog
WHERE (((Month([DateSignedIN]))=[Forms]![frmDRInput]![Month]) AND ((Year([DateSignedIN]))=[Forms]![frmDRInput]![Year]))
GROUP BY ActivityLog.Dat eSignedIN;[/CODE]
Here's the error msg:
Subqueries cannot be used in the expression (Round(Nz([GrandTotal],[ExpectedGrandTo tal]),2)).
if i hide the 'FinalGT' and the 'ExpectedTax' columns (FinalGT is the one with the troublesome code--i have to hide ExpectedTax, too b/c it returns a similar error msg), it runs fine.... which is wierd b/c 'ExpectedGT' and 'FinalGT' use the same format but they run fine... uhhhh why am i getting this error msg???
[CODE=sql]SELECT ActivityLog.Dat eSignedIN, Sum(ActivityLog .ProductPurchas ed) AS SumOfProductPur chased, Sum(ActivityLog .ProductAdj) AS SumOfProductAdj , Sum(ActivityLog .TaxPercent) AS SumOfTaxPercent , Sum(ActivityLog .Subtotal) AS SumOfSubtotal, Sum(ActivityLog .GrandTotal) AS SumOfGrandTotal , Sum(ActivityLog .TransactionTyp e) AS SumOfTransactio nType, Sum(Round((((([ProductPurchase d] + Nz([ProductAdj],0))*([TaxPercent]*2)) + (([Subtotal]-([ProductPurchase d] + Nz([ProductAdj],0)))*[TaxPercent]) + [Subtotal])+Nz([Shipping],0))+0.000001,2 )) AS ExpectedGrandTo tal, Sum(Round(Nz([GrandTotal],[ExpectedGrandTo tal]),2)) AS FinalGT, Sum(ActivityLog .Shipping) AS SumOfShipping, Sum(Round((([TaxPercent]*([Subtotal] - ([ProductPurchase d] + Nz([ProductAdj],0)))) + (2*([ProductPurchase d] + Nz([ProductAdj],0))*[TaxPercent]) + 0.00000001),2)) AS ExpectedTax, Sum(ActivityLog .ActualTax) AS SumOfActualTax, Sum(Round(Nz([ActualTax],[ExpectedTax]),2)) AS FinalTax, Sum([subtotal]-[productpurchase d]) AS Supplies
FROM ActivityLog
WHERE (((Month([DateSignedIN]))=[Forms]![frmDRInput]![Month]) AND ((Year([DateSignedIN]))=[Forms]![frmDRInput]![Year]))
GROUP BY ActivityLog.Dat eSignedIN;[/CODE]
Here's the error msg:
Subqueries cannot be used in the expression (Round(Nz([GrandTotal],[ExpectedGrandTo tal]),2)).
if i hide the 'FinalGT' and the 'ExpectedTax' columns (FinalGT is the one with the troublesome code--i have to hide ExpectedTax, too b/c it returns a similar error msg), it runs fine.... which is wierd b/c 'ExpectedGT' and 'FinalGT' use the same format but they run fine... uhhhh why am i getting this error msg???
Comment