在查询中用IIF如何写,另一部分怎样嵌套.
IIf([部门]="彩样室",IIf(([订单量]>=1) And ([订单量]<=2),[单价]*8,IIf(([订单量]>=3) And ([订单量]<=4),[单价]*6,IIf(([订单量]>=5) And ([订单量]<=6),[单价]*5,IIf(([订单量]>=7) And ([订单量]<=10),[单价]*4,IIf(([订单量]>=11) And ([订单量]<=30),[单价]*3,IIf([订单量]>30,[单价]*2,[单价])))))),[单价])
IIf([部门]="白样室",IIf(([订单量]>=1) And ([订单量]<=2),[单价]*5,IIf(([订单量]>=3) And ([订单量]<=5),[单价]*4,IIf(([订单量]>=6) And ([订单量]<=10),[单价]*3,IIf(([订单量]>=11) And ([订单量]<=20),[单价]*2,IIf([订单量]>20,[单价])))))),[单价])
还有判断是否样品单,如果是,则执行上面的条件,否则单价*2.
这几部分如何连接?
[此贴子已经被作者于2006-8-15 15:07:23编辑过]
|