Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Conversions for EAN Check Digit Needed???

Status
Not open for further replies.

hughed00

Technical User
Jan 15, 2001
43
0
0
US
I have an application that creates an EAN code (13 digit code of which the first 7 numbers are a purchased license and static, the next 5 assigned by the app, and the last digit is a check digit using the EAN ISO approved check digit algorithm).

I am struggling as to how to get this to work. I can create a 12 digit number, but the algorithim requires multiplication on each digit individually, followed by adding the sums, then subtracting from the next "10" (i.e. subtract 54 from 60 or 104 from 110).

The only way I have been able to concieve doing this is to take the numerals, convert to text, break them up into individual fields, reconvert to numbers, do the arithmatic manipulations, then reconstitute the individual numbers back to a 13 digit text field (it needs to be text in the end for other reasons related to another linked database used for reporting.

This seems like a lot of effort, does anyone know of a better simpler way to do something like this??
 
Sounds to me like you got it covered. Definitely a function... Terry M. Hoey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top