Query with multiple criteria

L

Love Buzz

Good morning.

I posted this question yesterday, but failed to give a good description of
what I am trying to do.

The SQL below is my attempt to group a list of accounts (DepositingAccount),
counting the total number of records for that account (CountofReturnReason),
and also to count the number of records in the MemoPostStatus column that
equal Over Drawn. When I try to run the query, I get the message 'This
expression is typed incorrectly, or it is too complex to be evaluated'

Any assistance would be greatly appreciated.

SELECT [Incoming Return Item Detail].DepositingAccount, [RCC Customer
List].[Customer Name], [RCC Customer List].[Sub Product], [RCC Customer
List].[Date Opened], Count([Incoming Return Item Detail].ReturnReason) AS
CountOfReturnReason, Count([Incoming Return Item Detail].MemoPostStatus) AS
CountOfMemoPostStatus1, [CountOfReturnReason]/[Numb of Dep Items] AS Expr1,
Sum([Incoming Return Item Detail].ItemAmount) AS SumOfItemAmount, [RCC
Customer List].[Officer Code], [SumOfItemAmount]/[$$ of Dep Items] AS Expr2
FROM [RCC Customer List] INNER JOIN [Incoming Return Item Detail] ON [RCC
Customer List].[Account #] = [Incoming Return Item Detail].DepositingAccount
WHERE ((([Incoming Return Item Detail].Date) Between [Start Date] And [End
Date]))
GROUP BY [Incoming Return Item Detail].DepositingAccount, [RCC Customer
List].[Customer Name], [RCC Customer List].[Sub Product], [RCC Customer
List].[Date Opened], [RCC Customer List].[Officer Code], [RCC Customer
List].[Numb of Dep Items], [RCC Customer List].[$$ of Dep Items]
HAVING (((Count([Incoming Return Item Detail].MemoPostStatus))="Over Drawn"));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top