Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 28 Apr 2010 @ 14:04:02 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Convert Access IIF to Teradata
 
From:   Leslie, Quincy

The syntax for the iif function is:

     iif ( condition, value_if_true, value_if_false )

     condition is the value that you want to test.

     value_if_true is the value that is returned if condition evaluates to TRUE.

     value_if_false is the value that is return if condition evaluates to FALSE.

First thought:

     IIf([AggregationCode]="M","Y","N") AS AggregationFlag,

Becomes SQL:

     CASE WHEN
     AggregationCode IN ('M','Y','N')THEN AggregationCode ELSE ''
     END AS AggregationFlag
     ======================
     IIf([RGWCount]<6,1,[RGWCount]) AS RGWC,

Becomes SQL:

     CASE WHEN
       RGWCount <6 THEN 1
        ELSE RGWCount
        END AS RGWC

My 2cw...



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 23 Jun 2019