I have three tables Transactions, Transaction Types,
The transactions file records relate to Many different financial transaction types. The most common thread is that they all relate to different MatterId's (one matterId to many transactions).
I need to sum 6 different payment transaction types for each matterId. They have to be summed but also take into account that trans code 104 needs to be changed to a negative figure for the sum
I have an expression in the query - TotPayments: IIf([Transactions.TransCode]="104",Sum(([Transactions.AmountTotal])*-1),Sum([Transactions.AmountTotal]))
The fields in my query are MatterId (Transactions) and Group By
TotPayments: (with the above expression
TransCpode (Transactions) Where "101" Or "104" Or "109" Or "199" Or "914" Or "915"
THE PROBLEM Error Your query does not include the specified expression IIf([Transactions.TransCode]="104",Sum(([Transactions.AmountTotal])*-1),Sum([Transactions.AmountTotal])) as part of an aggregate function
This is the code that is presented if I view it in SQL
I really do need some help on this one and it will be much appreciated
The transactions file records relate to Many different financial transaction types. The most common thread is that they all relate to different MatterId's (one matterId to many transactions).
I need to sum 6 different payment transaction types for each matterId. They have to be summed but also take into account that trans code 104 needs to be changed to a negative figure for the sum
I have an expression in the query - TotPayments: IIf([Transactions.TransCode]="104",Sum(([Transactions.AmountTotal])*-1),Sum([Transactions.AmountTotal]))
The fields in my query are MatterId (Transactions) and Group By
TotPayments: (with the above expression
TransCpode (Transactions) Where "101" Or "104" Or "109" Or "199" Or "914" Or "915"
THE PROBLEM Error Your query does not include the specified expression IIf([Transactions.TransCode]="104",Sum(([Transactions.AmountTotal])*-1),Sum([Transactions.AmountTotal])) as part of an aggregate function
This is the code that is presented if I view it in SQL
Code:
SELECT Transactions.MatterId, IIf([Transactions.TransCode]="104",Sum(([Transactions.AmountTotal])*-1),Sum([Transactions.AmountTotal])) AS TotPayments
FROM [Transaction Types] RIGHT JOIN Transactions ON [Transaction Types].TransTypeId = Transactions.TransCode
WHERE (((Transactions.TransCode)="101" Or (Transactions.TransCode)="104" Or (Transactions.TransCode)="109" Or (Transactions.TransCode)="199" Or (Transactions.TransCode)="914" Or (Transactions.TransCode)="915"))
GROUP BY Transactions.MatterId;
I really do need some help on this one and it will be much appreciated