What is the equivalent of Select Case in Access SQL?

后端 未结 3 1015
温柔的废话
温柔的废话 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 05:20

    You can use IIF for a similar result.

    Note that you can nest the IIF statements to handle multiple cases. There is an example here: http://forums.devshed.com/database-management-46/query-ms-access-iif-statement-multiple-conditions-358130.html

    SELECT IIf([Combinaison] = "Mike", 12, IIf([Combinaison] = "Steve", 13)) As Answer 
    FROM MyTable;
    

提交回复
热议问题