Hi Chuck, the function will not do what you want, 'cause the value you wanna asign to the variable is given by the function, the code should be like this:
WRONG: IIF(org.delegated,m.delegated='Y',m.delegated='N')
OK: m.delegatd=iif(org.delegated="Y","Y","N")
Try this.
Raúl O. Godoy
Salta - Argentina