What is the equivalent of Select Case in Access SQL?

后端 未结 3 1018
温柔的废话
温柔的废话 2020-11-30 04:28

I have a query which includes fields named openingbalance and commissions. I would like to compute values for commissions based on openingbala

3条回答
  •  广开言路
    2020-11-30 04:57

    You could do below:

    select
    iif ( OpeningBalance>=0 And OpeningBalance<=500 , 20, 
    
                      iif ( OpeningBalance>=5001 And OpeningBalance<=10000 , 30, 
    
                           iif ( OpeningBalance>=10001 And OpeningBalance<=20000 , 40, 
    
    50 ) ) ) as commission
    from table
    

提交回复
热议问题