Performing a calculation based on a field value

G

Guest

Hello, I'm very new to Access and need some help pleas:

I'm trying to calulate VAT and put this on the form, but only if the
supplier name does NOT contain the characters JCA.

So in English logic it would look something like this:

=if([Supplier Name] Not Like 'JCA') THEN [Text44]*0.175 ELSE 0

So if the supplier name does not contain the chars JCA, calulate the VAT and
put this value in the field. Otherwise don't calulate VAT and simply put 0
value in the field.

Now can anyone help me put this into Access 'speak' in the expression builder?
 
M

Marshall Barton

Craig said:
Hello, I'm very new to Access and need some help pleas:

I'm trying to calulate VAT and put this on the form, but only if the
supplier name does NOT contain the characters JCA.

So in English logic it would look something like this:

=if([Supplier Name] Not Like 'JCA') THEN [Text44]*0.175 ELSE 0

So if the supplier name does not contain the chars JCA, calulate the VAT and
put this value in the field. Otherwise don't calulate VAT and simply put 0
value in the field.

Now can anyone help me put this into Access 'speak' in the expression builder?


Skip the expression builder, you're already very close:

=IIf(([Supplier Name] Not Like '*JCA*'), Text44*0.175, 0)
 

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