HELP with Query

  • Thread starter Thread starter Robin
  • Start date Start date
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?
 
Hi Robin,

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

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

Regards,
Peter
 
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.
 
Back
Top