List all records but ...

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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)
 
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
 
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
 
Back
Top