sawilliams
Technical User
I am querying a table of salutations. I want to pull signor (salutation type) 2 if it exists or choose the default salutation if no signor 2 exists. I tried an iif statement sort of like this:
And I get what I want, but I get multiple rows unless I group by and even then I get a blank row. I feel I must be going about this the hard way. Would anyone care to enlighten me? Many thanks.
Code:
SELECT IIf([signor]=2,[esal1_desc],IIf([default_ind]="Y",[esal1_desc])) AS Expr1
FROM TX_CUST_SAL;
And I get what I want, but I get multiple rows unless I group by and even then I get a blank row. I feel I must be going about this the hard way. Would anyone care to enlighten me? Many thanks.