Assign a value based on another value within specified ranges

  • Thread starter Thread starter cd
  • Start date Start date
C

cd

i'm not 100% familiar with the Select Case option -
similar to If Then - however, based on the number of Tiers
you have, I'm thinking Select Case might work best.
instead of cycling through a bunch of If statements or IIf
statements, it would only find the correct Case that
matches.

Select Case Tier
Case 1
Dollar>44999 And Dollar <100000 Then Tier = 1
Case 2
Dollar>99999 And Dollar <200000 Then Tier = 2
etc
End Case

again, i am not familiar with the correct Select Case
method, so my code above will not work, but it gives you
an idea how it works. it just finds the correct dollar
range and applies the corresponding Tier. perhaps someone
more familiar with Select Case can provide you with more
precise coding. it is my understanding Select Case in
this type of situation is more efficient- it finds the
correct individual case instead of processing 14 If Then
or IIf statements - thereby speeding up the database.
 
i'm not 100% familiar with the Select Case option -
similar to If Then - however, based on the number of Tiers
you have, I'm thinking Select Case might work best.

It would... in SQL Server. Unfortunately it's not supported in JET
SQL.
 

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

Back
Top