Each row in Accounts needs to be assigned a person from Counselors. The way the client prefers to do this is like
Fred gets Accounts where last name has starting letters from 'a' through 'fe'
We're trying to give them "better service" by letting them change the criteria, but of course we don't want them to have to write SQL.
I can see at least three ways to do it, except that I don't see the entire way.
Method one:
Counselor GE LT
--------- --- ----
Fred a ff
Sally ff ko
etc.
Here, my challenge is to automatically keep LT(i) = GE(i+1) rather than requiring the user to understand and apply the difference between exclusive and inclusive endpoints. (Also have to prevent them from getting out of order.)
Method two:
Counselor GE
--------- ---
Fred a
Sally ff
etc.
If the name is Adams or Felton, Fred will match >=
But if it's Fox, Fred and Sally will match. Here my challenge is to only take the first match for each row in Accounts.
The VB method would loop through Counselors, and return the first match. Not too hard, but it would be nice to keep it in the SQL.
--
Wes Groleau
Fred gets Accounts where last name has starting letters from 'a' through 'fe'
We're trying to give them "better service" by letting them change the criteria, but of course we don't want them to have to write SQL.
I can see at least three ways to do it, except that I don't see the entire way.
Method one:
Counselor GE LT
--------- --- ----
Fred a ff
Sally ff ko
etc.
Here, my challenge is to automatically keep LT(i) = GE(i+1) rather than requiring the user to understand and apply the difference between exclusive and inclusive endpoints. (Also have to prevent them from getting out of order.)
Method two:
Counselor GE
--------- ---
Fred a
Sally ff
etc.
If the name is Adams or Felton, Fred will match >=
But if it's Fox, Fred and Sally will match. Here my challenge is to only take the first match for each row in Accounts.
The VB method would loop through Counselors, and return the first match. Not too hard, but it would be nice to keep it in the SQL.
--
Wes Groleau