G
Gwen H
How do I tell the following SQL from a crosstab query to average the
crossSell.newCustomers field **ONLY** if that field contains a value greater
than zero (0)? I have tried enclosing the Avg function following TRANSFORM in
an Iif statement, but I get an error message.
TRANSFORM Avg(crossSell.newCustomers) AS AvgOfnewCustomers
SELECT crossSell.Branch, Avg(crossSell.newCustomers) AS [Total newCustomers]
FROM crossSell
GROUP BY crossSell.Branch
PIVOT crossSell.[B#];
I'm trying to accomplish something like this:
TRANSFORM Iif([crossSell.newCustomers] > 0, avg(crossSell.newCustomers),
sum(crossSell.newCustomers))
Thanks in advance for your help!
crossSell.newCustomers field **ONLY** if that field contains a value greater
than zero (0)? I have tried enclosing the Avg function following TRANSFORM in
an Iif statement, but I get an error message.
TRANSFORM Avg(crossSell.newCustomers) AS AvgOfnewCustomers
SELECT crossSell.Branch, Avg(crossSell.newCustomers) AS [Total newCustomers]
FROM crossSell
GROUP BY crossSell.Branch
PIVOT crossSell.[B#];
I'm trying to accomplish something like this:
TRANSFORM Iif([crossSell.newCustomers] > 0, avg(crossSell.newCustomers),
sum(crossSell.newCustomers))
Thanks in advance for your help!