List all records but ...

G

Guest

Hello everyone
I'm not an expert on this but here is the thing : a simple query that reads
all records from one table, Sales. I have a field named comissions. It's a
simple product from Value multiplied to 6%.
My question is : How to list all records of my sales, and that field,
comissions, with zero value if another field, Vend, has a "yes" value,
otherwise simply show me the product.
Quite easy for you.lol
Tks in advance
Pedro
 
R

Rick Brandt

Pedro said:
Hello everyone
I'm not an expert on this but here is the thing : a simple query that
reads all records from one table, Sales. I have a field named
comissions. It's a simple product from Value multiplied to 6%.
My question is : How to list all records of my sales, and that field,
comissions, with zero value if another field, Vend, has a "yes" value,
otherwise simply show me the product.
Quite easy for you.lol
Tks in advance
Pedro

If Vend is an actual Yes/No DataType...

Commissions: IIf(Vend, 0, Value * 0.06)

If Vend is a Text DataType...

Commissions: IIf(Vend = "Yes", 0, Value * 0.06)
 
G

Guest

Hey Rick
I'm portuguese by the way and so is my access.

I've use, the first expression, like this :

Comis VD: Se([Comissionavel];0;[Margem Adjudicado]*0,06)

And it returns an error like " the funcion IF is not defined in the
expression"

Kinda weird no? Also i've noticed that on your instrucion the IF has another
I. Am i missing something?

Tks again for your pacience
Pedro
 
G

Guest

Hey again Rick
Forget what i said above. It's working.
Kinda weird : If i use IF it means in portuguese SE. This query works with
IIF and.
Tks lot
Pedro
 

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