【发布时间】:2014-03-03 02:55:11
【问题描述】:
我有一个跟踪玩家统计数据的表格:
Player Pts Reb Ast Blk Stl Tov
Jeff Teague 21 11 15 1 2 4
我想添加一个计算字段来计算该玩家得分的幻想点数。玩家得到:
1 fantasy point per Pts
1.25 fantasy points per Reb
1.5 fantasy points per Ast
2 fantasy points per Ast
2 fantasy points per Stl
-.5 fantasy points per Tov
1.5 fantasy points IF any two of Pts, Reb, Ast, Blk, or Stl are 10 or more
3 fantasy points IF any three of Pts, Reb, Ast, Blk, or Stl are 10 or more
所以在这个例子中他会得到 (21)+(11*1.25)+(15*1.5)+(2)+(2*2)-(.5*4)+(1.5)+(3) = 61.75 幻想点数。额外的 1.5 和 3 是因为 Pts、Ast 和 Reb 都是 10 或更大。
到目前为止,我拥有的计算字段:
([PTS])+([TRB]*1.25)+([AST]*1.5)+([STL]*2)+([BLK]*2)-([TOV]*.5)
但我不知道如何包含最后两个因素的 IF 语句。
【问题讨论】:
-
每个 Ast 1.5 个幻想点 每个 Ast 2 个幻想点。你说 Ast 得 1.5 和 2 分
标签: sql ms-access calculated-columns