If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Infomix CASE or DECODE statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-03, 13:03
MGazzo MGazzo is offline
Registered User
 
Join Date: Oct 2003
Posts: 2
Infomix CASE or DECODE statement

Hi

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On