iif - Issue with Specific Nested If Statement in MS Access -


i created nested iif statement in 2010 access , part works. there once line not populate correctly:

select     iif([qrymarate]![commissionable],       iif([qrymarate]![year]="2013",          iif([forms]![frmmarate]![chktrueup],             [qrymarate]![agentinitial],             [qrymarate]![agentrenewal]),          iif([forms]![frmmarate]![chktrueup],             iif([qrymarate]![prorated],                [qrymarate]![agentinitial]*([forms]![frmmarate]![cbomonth]/12),                [qrymarate]![agentinitial]), <--- line not populate             [qrymarate]![agentrenewal]*([forms]![frmmarate]![cbomonth]/12))),       null) agentrate qrymarate; 

the goal of statement pick out if there should commission amount , either display commission or pro-rate based upon month commission earned.
else in statement it's supposed 1 line. not matter put in line not populate.

easiest answer ever, iif statement not recognizing y , n possible t/f response, updated prorated iif statement to:

iif([qrymarate]![prorated] = "yes", 

see comment above

select iif([qrymarate]![commissionable],   iif([qrymarate]![year]="2013",      iif([forms]![frmmarate]![chktrueup],         [qrymarate]![agentinitial],         [qrymarate]![agentrenewal]),      iif([forms]![frmmarate]![chktrueup],         iif([qrymarate]![prorated] = "y",            [qrymarate]![agentinitial]*([forms]![frmmarate]![cbomonth]/12),            [qrymarate]![agentinitial]), <--- line not populate         [qrymarate]![agentrenewal]*([forms]![frmmarate]![cbomonth]/12))),   null) agentrate qrymarate; 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -