If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Using IIF in a Stored Procedure linked to a Report
Hello,
Need help with the following problem, please. Access Report (linked to a Stored Procedure) has the following calculated field [text10] in the Detail section: =IIF(IS NULL(DATE_PURCHASE),NULL, (COMMISSIONS/100)*COST_PRUDUCT) but =Sum(IIF(IS NULL(DATE_PURCHASE),NULL, (COMMISSIONS/100)*COST_PRUDUCT)) or =Sum([text10]) doesn't work simply because as I said, the Report is linked to a Stored Procedures. Access help pages direct me to calculate my Report field in the Query (in this case Stored Procedures). So the bottom line is I need to use the IIF statement in a Stored Procedure. I understand that such statement cannot be used but in its place to use CASE. However, the Stored Procedure is generated using INNER JOIN of several tables and the CASE syntax doesn't work. Works only if one table is used. Therefore, I need to use the following equation in a Stored Procedure, HOWTO? =IIF(IS NULL(DATE_PURCHASE),NULL, (COMMISSIONS/100)*COST_PRUDUCT) TIA, Elen |
#2
|
|||
|
|||
Using IIF in a Stored Procedure linked to a Report
"Elen" wrote in message ... I understand that such statement cannot be used but in its place to use CASE. However, the Stored Procedure is generated using INNER JOIN of several tables and the CASE syntax doesn't work. Works only if one table is used. Can you post the full query with your CASE syntax that's not working? Probably just a matter of a typo or something. |
Thread Tools | |
Display Modes | |
|
|