[AccessD] adding control number

pedro at plex.nl pedro at plex.nl
Fri Aug 26 11:11:05 CDT 2005


Hello Group,

I have an ID (text, because it begins with 00) that exist of 8 numbers.
I need to change this ID by removing the first 0, and by adding a extra control number.
This control number can be calculated from this ID. This can be done by several query’s. Is it possible to do in one query??

For example.

I have ID:  00327833

Take the number of the odd positions:    0 3 7 3

Place these numbers behind each other to make one number:    0373

Multiply this number with 2:    0373 x 2 = 0746

Count up the separate numbers from this last multiplication:    0 + 7 + 4 + 6 = 17

>From the original ID, take the even positions:    0 2 8 3

Count up the separate numbers from the even positions with the sum of the last count up:    17 + 0 + 2 + 8 + 3 = 30

The last number of the previous sum is the extra control number:    0

>From the original ID, remove the first 0 and add the control number:    03278330


Who can help me with this?

TIA

Pedro Janssen




More information about the AccessD mailing list