R
Rick Brandt
I am trying to create a query that includes several columns, of which each
of these columns is a sum of an amount field, however each column has
different selection criteria.
How do i get this to work? as my current query works fine with one field but
as soon as you add the second it doesn't return anything because the having
clause is combined into 1 instead for each individual column.. for example..
Sum1: Amount Sum2: Sum(Amount) Sum3: Sum(Amount)
Total: Sum Total: Sum Total: Sum
Criteria Class = "A" Criteria Class = "B" Criteria Class = "C"
This is not working?? when i look at my SQL it's been combined into one huge
select statement with 1 having clause, instead if individual having clauses
for each column name.
What am i doing wrong?
You can't have different criteria per column, but you can fake it with
expressions like this...
Sum1: Sum(IIf([Criteria Class]="A",[Amount],0))
Sum2: Sum(IIf([Criteria Class]="B",[Amount],0))
Sum3: Sum(IIf([Criteria Class]="C",[Amount],0))