Link to home
Start Free TrialLog in
Avatar of akh7025
akh7025

asked on

You tried to execute a query that doesn't include the specified expression as part of an aggregate function

Heres the query

Price Each USD: IIf(Left([mc476mth]![plant],2)="BR",([mm60]![price]/[Forms].[main]![brl to usd]),IIf(Left([mc476mth]![plant],2)="CA",([mm60]![price]/[Forms].[main]![cad to usd]),IIf(IsNull([mc476mth]![plant]),"N/A")))

What's wrong w/ this?  Even if I change it to a "GROUP BY" it still gives me the same error.
Avatar of nico5038
nico5038
Flag of Netherlands image

Try:

[Price Each USD]: IIf(Left([mc476mth]![plant],2)="BR",([mm60]![price]/[Forms].[main]![brl to usd]),IIf(Left([mc476mth]![plant],2)="CA",([mm60]![price]/[Forms].[main]![cad to usd]),IIf(IsNull([mc476mth]![plant]),"N/A")))

The [ and ] is needed for the spaces, better never to use spaces in fieldnames...

Nic;o)
Can you post the whole SQL Statement?

Thanks,
Mike
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial