Somebody help! on If...,Then....ElseIf

G

Gorros

'll be pleased if somebody could help me generate an expression or better
still a statement that will evaluate a value in a field and represent it with
a txt in another field.
Is thre a way out?

An example is;

If Totals >70, Then Grade=A
ElseIf Totals >60but<70 Grade=B
Else......till F.Where the options will end.

NB. Totals and Grade are fields on a query.
Thanks for helping.
 
O

Ofer Cohen

In the query create a new field, using IIf

Grade : IIf([Totals]>70,"A",IIf([Totals]>60,"B","C"))
 
M

MH

Use the SWITCH function:

SWITCH([Totals]>70,"A",[Totals]>60,"B",[Totals]>50,"C",[Totals]>40,"D")

etc.

MH
 
G

Gorros

Cohen,
that was just what i was looking for. am grateful, but you are great!
Nice Things! To HM also.

Ofer Cohen said:
In the query create a new field, using IIf

Grade : IIf([Totals]>70,"A",IIf([Totals]>60,"B","C"))

--
Good Luck
BS"D


Gorros said:
'll be pleased if somebody could help me generate an expression or better
still a statement that will evaluate a value in a field and represent it with
a txt in another field.
Is thre a way out?

An example is;

If Totals >70, Then Grade=A
ElseIf Totals >60but<70 Grade=B
Else......till F.Where the options will end.

NB. Totals and Grade are fields on a query.
Thanks for helping.
 
G

Gorros

MH,
That was great you know?
Keep helping. am grateful. Stay kull

MH said:
Use the SWITCH function:

SWITCH([Totals]>70,"A",[Totals]>60,"B",[Totals]>50,"C",[Totals]>40,"D")

etc.

MH


Gorros said:
'll be pleased if somebody could help me generate an expression or better
still a statement that will evaluate a value in a field and represent it
with
a txt in another field.
Is thre a way out?

An example is;

If Totals >70, Then Grade=A
ElseIf Totals >60but<70 Grade=B
Else......till F.Where the options will end.

NB. Totals and Grade are fields on a query.
Thanks for helping.
 
Top