IFF Statment

Local time
Today, 09:55
Joined
Jul 13, 2011
Messages
28
Hi I wounder if someone could help me in this issue that I have

I have four fields called the following

Score 1 score 2 Score 3 and Score 4

I run a query to add up score 1 and score 3 to give me a plus total with the following statment

Abs(Sum([Score 1]+[Score 3]))

The problem I am having is if the player who has scored in score 1 & 2 has did not play for a score to be registed in 3 and 4 i need an iff statment to show the following
Abs(Sum([Score 1]+[Score 3])) if score 3= blank (no data entered) then just add Score 1

Example Below

Score 1 = For 21 Score 2 -10 against Score 3=0 as player did not play

So total score for shoud show 21 then if he played another home game and wins 21 again and misses the asway game the iff statment should then add the two 21s together.

Hope this make sense
 
First of all:
iif not iff
So, to use in a query: =iif(condition,true,false) <- similar to Excel

Hope that helps,
Goh
 
Hi;
Do I understand correctly I do not know ??
Try it;

Sum(nz([Score 1],0)+nz([Score 3],0))

or maybe u want it??

iif(isnull(score3),score1,score1+score3)
 
Last edited:
iif(isnull(score3),score1,score1+score3)

The above sounds like what you were trying to describe earlier.. I didn't quite understand all of your explanation; however, the above statement basically says:

if the field "score3" is null then use "score1", but if "score3" not null then use "score1" plus "score 3"

BTW 'iif' stands for 'Immediate IF'. That how you can remember that it iif not iff.

Hope that helps,
Goh
 
Hi GohDiamons

What you have written sounds about wright anyhow could you please show me how i tag what you have written on to the end of this sum forumulae with the correct brackets as ive tried it and it does not seem to work
Won: Abs(Sum([Won Home]+[Won Away]))
iif(isnull(score3),score1,score1+score3)
 

Users who are viewing this thread

Back
Top Bottom