A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using IIF in a Stored Procedure linked to a Report



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 10:20 AM
Elen
external usenet poster
 
Posts: n/a
Default 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  
Old May 25th, 2004, 02:29 PM
Adam Machanic
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.