2016-09-19 84 views
-1

我在努力弄清楚下面的表達式中缺少什麼。我感謝所有的幫助!MS Access IIF聲明缺少關閉的括號

SKU_Qty: 
Sum(IIf([SKU Breakout 004]![Year_Week] >= [z Calendar Reset]![Year-Week-Disco] AND [SKU Breakout 004]![Year_Week] < [z Calendar Reset]![Year-Week-Ship], IIf([SKU Breakout 003]![Distribution Type] = "DELETE",0,[SKU Breakout 003]![SKU_Cust_Mix_Current%]*[SKU Breakout 004]![Qty], IIf([SKU Breakout 004]![Year_Week] < [z Calendar Reset]![Year-Week-Disco], [SKU Breakout 003]![SKU_Cust_Mix_Current%]*[SKU Breakout 004]![Qty] , [SKU Breakout 003]![SKU_Cust_Mix_Future%]*[SKU Breakout 004]![Qty])) 
+2

你可能想給更多的細節 –

回答

0

你有4個左括號,只有2個關閉,所以你應該關閉另外兩個。

你應該勾勒出你表達了一下,不會迷失在如何巢:

Sum(
    IIf( 
     [SKU Breakout 004]![Year_Week] >= [z Calendar Reset]![Year-Week-Disco] 
     AND [SKU Breakout 004]![Year_Week] < [z Calendar Reset]![Year-Week-Ship], 
     IIf( 
      [SKU Breakout 003]![Distribution Type] = "DELETE", 
      0, 
      [SKU Breakout 003]![SKU_Cust_Mix_Current%]*[SKU Breakout 004]![Qty], 
      IIf(
       [SKU Breakout 004]![Year_Week] < [z Calendar Reset]![Year-Week-Disco], 
       [SKU Breakout 003]![SKU_Cust_Mix_Current%]*[SKU Breakout 004]![Qty] , 
       [SKU Breakout 003]![SKU_Cust_Mix_Future%]*[SKU Breakout 004]![Qty] 
       ) 
      ) 

現在你清楚地看到,有一些缺失。也許你需要這個:

Sum(
    IIf( 
     [SKU Breakout 004]![Year_Week] >= [z Calendar Reset]![Year-Week-Disco] 
     AND [SKU Breakout 004]![Year_Week] < [z Calendar Reset]![Year-Week-Ship], 
     IIf( 
      [SKU Breakout 003]![Distribution Type] = "DELETE", 
      0, 
      [SKU Breakout 003]![SKU_Cust_Mix_Current%]*[SKU Breakout 004]![Qty] 
     ), 
     IIf(
      [SKU Breakout 004]![Year_Week] < [z Calendar Reset]![Year-Week-Disco], 
      [SKU Breakout 003]![SKU_Cust_Mix_Current%]*[SKU Breakout 004]![Qty] , 
      [SKU Breakout 003]![SKU_Cust_Mix_Future%]*[SKU Breakout 004]![Qty] 
      ) 
     ) 
)