G
Guest
I need to create a validation rule to validate that an identifcation number I
put into a table is actually a CAS RN (chemical substance id number).
CAS #'s can be up to nine digits in the form NNNNNN-XX-C.
The first six N's can be any number, with any of the digits omitted. Only
one digit is required for the X's, but two can be present. The C represents
the check digit.
To calculate a checksum for a CAS Number:
starting at the second-last digit and progressing to the left, number each
digit from 1 to N, Then, multiply each digit by the number you assigned. Add
the sums, and take the last digit of that sum, this digit should match the
last digit (C) of the CAS number.
I've been having problems figuring this one out. The problems that I see
are that the CAS can be any where from 3 to 9 digits long, so a simple imput
mask doesn't hlep much. Maybe you have the answer!
put into a table is actually a CAS RN (chemical substance id number).
CAS #'s can be up to nine digits in the form NNNNNN-XX-C.
The first six N's can be any number, with any of the digits omitted. Only
one digit is required for the X's, but two can be present. The C represents
the check digit.
To calculate a checksum for a CAS Number:
starting at the second-last digit and progressing to the left, number each
digit from 1 to N, Then, multiply each digit by the number you assigned. Add
the sums, and take the last digit of that sum, this digit should match the
last digit (C) of the CAS number.
I've been having problems figuring this one out. The problems that I see
are that the CAS can be any where from 3 to 9 digits long, so a simple imput
mask doesn't hlep much. Maybe you have the answer!