Help with a IIf Statement Expression.

diazr

Registered User.
Local time
Today, 15:55
Joined
Jul 31, 2008
Messages
24
I have the following expression in a Query and for some reason its giving me correct results for the part of the expression of [AMOUNT] but it is not calculating [TRANSTYPE] ="Cash-In" the end result shows Cash-In and also Cash-Out.. When It should only give me Cash-In transactions. Is the expression build correctly?

In a nut shell the expression below should give me a count of [AMOUNT] that are between 0.00 and 10,000 and that their [TRANSTYPE] is only equal to Cash-In. Any help would be appreciated..

Range_0_10: Count((((IIf([AMOUNT]<=10000 And [AMOUNT]>0 And [TRANSTYPE]="Cash-In",1,0)))))
 
I have the following expression in a Query and for some reason its giving me correct results for the part of the expression of [AMOUNT] but it is not calculating [TRANSTYPE] ="Cash-In" the end result shows Cash-In and also Cash-Out.. When It should only give me Cash-In transactions. Is the expression build correctly?

In a nut shell the expression below should give me a count of [AMOUNT] that are between 0.00 and 10,000 and that their [TRANSTYPE] is only equal to Cash-In. Any help would be appreciated..

Range_0_10: Count((((IIf([AMOUNT]<=10000 And [AMOUNT]>0 And [TRANSTYPE]="Cash-In",1,0)))))

Can you try to see what happens when you make that Sum() instead of count(). I also think that some of the "(" and ")" characters are missing and others are redundant. Try this instead:
Code:
Range_0_10: Sum[COLOR=blue][B]([/B][/COLOR]IIf[B][COLOR=red]([/COLOR][COLOR=darkorange]([/COLOR][COLOR=seagreen]([/COLOR][/B][AMOUNT]<=10000[COLOR=seagreen][B])[/B][/COLOR] And [COLOR=seagreen][B]([/B][/COLOR][AMOUNT]>0[COLOR=seagreen][B])[/B][/COLOR] And [COLOR=seagreen][B]([/B][/COLOR][TRANSTYPE]="Cash-In"[B][COLOR=seagreen])[/COLOR][COLOR=darkorange])[/COLOR][/B],1,0[B][COLOR=red])[/COLOR][COLOR=blue])[/COLOR][/B]
 
Thanks! MSAccessRookie... The formula adjustment you made worked out well.
 

Users who are viewing this thread

Back
Top Bottom