Star Gazr1
asked on
T-SQL (advanced custom function)
This is a challenging question, so I can understand if I get no responses but I thought I would give a shot. Thanks for any help you can give.
I have a 15 Digit customer number that I need to calculate a check digit for that value.
In order to come up with the check digit I use Excel (formula is below).
This formula is based on something called the Luhn Algorithm (I think that is the correct spelling).
The 15 digit customer number is stored in a SQL Server 2000 Database.
I would like to be able to get this calculation using a T-SQL Function rather than
Excel. Does anyone know how is can do this with T-SQL on a SQL Server 2000 database
Excel Formula that will give me a check digit from a 15 digit number
=MOD(SUMPRODUCT(-MID(TEXT( MID(A2,ROW (INDIRECT( "1:"&LEN(A 2))),1)*(M OD(ROW(IND IRECT("1:" &LEN(A2))) +LEN(A2)+1 ,2)+1),"00 "),{1,2},1 )),10)
I have a 15 Digit customer number that I need to calculate a check digit for that value.
In order to come up with the check digit I use Excel (formula is below).
This formula is based on something called the Luhn Algorithm (I think that is the correct spelling).
The 15 digit customer number is stored in a SQL Server 2000 Database.
I would like to be able to get this calculation using a T-SQL Function rather than
Excel. Does anyone know how is can do this with T-SQL on a SQL Server 2000 database
Excel Formula that will give me a check digit from a 15 digit number
=MOD(SUMPRODUCT(-MID(TEXT(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@arcee123 it works!. Thanks for posting the full steps on how to run as well.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76195