HELP with Query

R

Robin

Here's my problem: Sales tax= If a customer lives in CA, calculate the sales
tax as 7% otherwise calculate sales tax as 5.5%. How can I build a
calculation expression in a query to do this?
 
H

Hardhit

Hi Robin,

I would enter in one of the query colums the following statement.

tax : iif(State = 'CA';7;5.5)

Regards,
Peter
 
D

Duane Hookom

I would create a data-driven solution that uses a table to store the state
and rate. I would not hard-code the state code and the 7 or 5.5% into an
expression since the values are bound to change. You should not have to go
back to your queries to find and replace the hard-coded values.
 

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

Similar Threads

One to many Relationship in one record 6
Total Query 2
percentage calculation...trying again 26
percentage calculation 2
Query to identify missing tax returns 3
Formula 2
Nested IIf statement use 4
If calculations 3

Top