July 2010
Intermediate to advanced
840 pages
16h 33m
English
This is a list of miscellaneous tricks that you might not think about when using strings.
A weird way of providing an edit mask for a varying character column to see if it has only digits in it was proposed by Ken Sheridan on the CompuServe ACCESS forum in October 1999. If the first character is not a zero, then you can check that the VARCHAR(n) string is all digits with:
CAST (LOG10 (CAST (test_column AS INTEGER) AS INTEGER) = n
If the first (n) characters are not all digits, then it will not return (n). If they are all digits, but the (n+1) character is also a digit, it will return (n+1), and so forth. If there are nondigit characters in the string, then the innermost CAST() function ...
Read now
Unlock full access