Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble writing an IIF statement

Status
Not open for further replies.

aageorge

Technical User
Jun 28, 2003
51
US
I have the following control source for a textbox in my report footer:

Sum(IIf([Shift]='Aft',[Expr1],0))

It very simply sums up Expr1 for Aft shifts. The problem is a few lines don't run Aft shifts and the text box returns a value of 'Num#'. How do you I write an expression that returns '-' if Aft shift does not exist for that line?
 
in your detail section include a text box (text1) that determines whether the [Shift] field = Aft and if so it sets the value = [Expr1] otherwise to 0.

=iif([Shift]="Aft",[Expr1],0)

set the running sum of text1 to Over Group (maybe Over All - you may need to play with this).

set the visible property to No.

then in your footer, insert another textbox and set its control source to text1.

=[Text1]

it should give you the sum of the Expr1 where Shift = Aft.

hope this helps you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top