我的IIF声明有什么问题我一直收到错误

时间:2016-12-10 16:10:58

标签: sql ms-access

Private Sub cmdUnesiUBazu_click()
     Sheet1.Activate

    Range("B2").End(xlDown).Offset(1, 0).Select ' want to start write from C2 cell
    ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1

    ActiveCell.Offset(0, 1).Value = txtSifraOsobe.Value
    ActiveCell.Offset(0, 2).Value = txtImeIPrezime.Value
    ActiveCell.Offset(0, 3).Value = txtAdresa.Value
    ActiveCell.Offset(0, 4).Value = cboGrad.Value
    ActiveCell.Offset(0, 5).Value = cboDrzava.Value
    ActiveCell.Offset(0, 7).Value = txtDatumRodjenja.Value

  End Sub

ERROR MESSAGE

我无法完成此声明。我的iif语句一直给我错误

1 个答案:

答案 0 :(得分:0)

问题是前一行缺少逗号和 private IApp _app = ScenarioContext.Current.Get<IApp>("Application"); private readonly ILoginScreen _loginScreen; private readonly IMainMenuScreen _mainMenuScreen; public Login(ILoginScreen loginScreen, IMainMenuScreen mainMenuScreen) { _app.Repl(); _loginScreen = loginScreen; _mainMenuScreen = mainMenuScreen; } 子句中的额外逗号。

我应该注意您也可以使用WHERE

switch()

注意:

  • 我在小数点前加select description as FOOD, price, price_increase, switch(price_increase < 0.10 * price or price_increase is null, 'Less than 10% Increase', price_increase > 0.15 * price, 'Greater that 15% increase ' ) from l_foods where price_increase < 0.10 * price or price_increase is null or price_increase > 0.15 * price order by description; ,因此小数点更容易阅读。
  • 我更喜欢乘法除法,因为错误的危险很小(我想可能存在溢出错误,但这比除以零的可能性小得多)。
  • 0没问题,因为您不需要默认选项。 switch()子句会过滤掉这些内容。