我对编写 NetSuite sql case 语句很陌生。我已经能够使用单个 WHEN 条件成功编写 CASE 语句,但是当我包含多个 WHEN 条件时,NetSuite 返回“无效表达式”错误。我想知道是否需要将 WHEN 条件与空格以外的其他内容分开。我见过具有多个 WHEN 条件的嵌套语句示例,但 NetSuite 不允许在公式字段中嵌套语句。这是我返回错误的语句:
CASE WHEN {item.custitem_custid} IN (05,12)
THEN {amount}*{item.custitem_sharedat50}
WHEN {item.custitem_custid} IN (37,42,76)
THEN {amount}*0.02 ELSE {amount}*{item.custitem_sharedat33}
END
这是我的 CASE 语句,其中包含一个有效的 WHEN 条件:
CASE WHEN {item.custitem_custid} IN (05,12)
THEN {amount}*{item.custitem_sharedat50}
ELSE {amount}*{item.custitem_sharedat33} END
有NetSuite经验的人有什么想法吗?