Calculated field with multiple criteria

F

Fipp

I have a table that contains information about plays in a football game. In
the table there are the following 3 fields:

1. Down
2. Distance
3. Gain

I would like to make another field calculated off of those 3 fields Based of
the following criteria.

If down is = 1 and gain is < 4 I would like the result of the calculated
field to be "Yes"
If down is = 2 and gain is < 1/2 the value of distance the calculated field
should = "Yes"
If down is =3 and gain is < distance the value of the calculated fied should
= "Yes"
If down is =4 and gain is < distance the value of the calculated fied should
= "Yes"

Any recomendations on how to accomplish this would be much appreciated.
 
K

KARL DEWEY

Try this --
SELECT fipp.down, fipp.distance, fipp.gain, IIf(([down]=1 And [gain]<4) Or
([down]=2 And [gain]<([distance]/2)) Or (([down]=3 Or [down]=4) And
[gain]<[distance]),"Yes","No") AS x
FROM fipp;
 
F

Fipp

Is there a way to make one if down = 1 and gain = null result should be "yes"
I tried to add the following in but it doesn't seem to be changing it?

(([dn]=1 And [gain]=Null)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top