I'm new to Informix db's. I created a query in access that selects records from an informix db. I now want to move the sql to a macro in Excel but am having problems with some of the sql expressions.

In my original Access query, I created several computed columns using the equivalent of a decode or case statement to select amounts for specific accounts. In Access, I used an IIF functionlike this IIF([acct_gen] between '410' and '420', [our_amount], 0) and the query returned data correctly.

I now want to use the same query in an Excel macro and I get sql syntax errors. I tried a decode statement instead of the IIF statements and a decode works only if my decode uses columns from the same table? (I got an error stating that the attributes of my decode must come from the same table).

Anyway I'm using multiple tables and I want to create computed columns based on a decode or case statment and would appreciate help with syntax or other functions to make this happen.

thanks for any help