Help With Expression Query

C

CS

I have a simple expression query that I just can not get.
I have a table called discs, in this table there is a logical field (yes,no)
called clubs. I want to be able to use the expression builder so that if the
club value equals yes then the Charge(name of the expression I am trying to
build) will equal 45, if not then equals 65. I am just confusing myself.
Sorry I am new to this and would appreciate any help that anyone could
provide. Thank you and have a great day.
 
R

Rick Brandt

CS said:
I have a simple expression query that I just can not get.
I have a table called discs, in this table there is a logical field (yes,no)
called clubs. I want to be able to use the expression builder so that if the
club value equals yes then the Charge(name of the expression I am trying to
build) will equal 45, if not then equals 65. I am just confusing myself. Sorry
I am new to this and would appreciate any help that anyone could provide.
Thank you and have a great day.

Charge: IIf([clubs], 45, 65)

The above assumes that you are using a DataType of Yes/No for the clubs field.
Your description does not make that clear. If it is a Text field containing the
words "Yes" and "No", then the expression would need to be...

Charge: IIf([clubs] = "Yes", 45, 65)
 
D

David F Cox

Sorry, I cannot remember when I last used expression builder, but, in QBE
view, using the function IIF :-

ans: IIF([clubs],45,65)
sets a column called answer to 45 or 65.

IIF( test, result if true, result if false)
 
C

CS

Thank you very much Rick, your help was greatly appreciated. Once again
thank you.
Rick Brandt said:
CS said:
I have a simple expression query that I just can not get.
I have a table called discs, in this table there is a logical field
(yes,no) called clubs. I want to be able to use the expression builder so
that if the club value equals yes then the Charge(name of the expression
I am trying to build) will equal 45, if not then equals 65. I am just
confusing myself. Sorry I am new to this and would appreciate any help
that anyone could provide. Thank you and have a great day.

Charge: IIf([clubs], 45, 65)

The above assumes that you are using a DataType of Yes/No for the clubs
field. Your description does not make that clear. If it is a Text field
containing the words "Yes" and "No", then the expression would need to
be...

Charge: IIf([clubs] = "Yes", 45, 65)
 

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