I have this:
I get invalid procedure call
If I change it to
of course then the iif statement is not part of an aggregate function
So I tried
and it wants a paramter for order_number
and to make sure that the iif in the where clause was the actual problem, I did:
which works but is not what I want. So, how does access sql work with aliases and such. In MySql, this took two seconds because you can use the alias anywhere
Code:
select iif(very long iif statement) as order_number, mid([a],1,2) as larry,more items
from ...
group by iif(very long iif statement), mid([a],1,2)
If I change it to
Code:
select iif(very long iif statement) as order_number, mid([a],1,2) as larry,more items
from ...
group by [order_number], mid([a],1,2)
of course then the iif statement is not part of an aggregate function
So I tried
Code:
select first(iif(very long iif statement)) as order_number, mid([a],1,2) as larry,more items
from ...
group by [order_number], mid([a],1,2)
and to make sure that the iif in the where clause was the actual problem, I did:
Code:
select first(iif(very long iif statement)) as order_number, mid([a],1,2) as larry,more items
from ...
group by mid([a],1,2)
which works but is not what I want. So, how does access sql work with aliases and such. In MySql, this took two seconds because you can use the alias anywhere