Kbase P108340: How to get all customer records where last 3 digits in custNum are 100?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  31/08/2005 |
|
Status: Unverified
GOAL:
How to get all customer records where last 3 digits in custNum are 100?
FIX:
FOR EACH customer NO-LOCK WHERE custNum MODULO 1000 = 100.
If custNum would have been a CHARACTER field then use:
FOR EACH customer WHERE SUBSTRING( custNum, LENGTH( custNum ) - 2 ) = "100"
Please none of the methods above take advantage of using indexes i.e. a full table scan is performed.