[AccessD] adding control number

Lonnie Johnson prodevmg at yahoo.com
Fri Aug 26 05:32:55 CDT 2005


Why not write a function in VBA and do everything you just said instead of using your queries? How is your VBA?

pedro at plex.nl wrote: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

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




May God bless you beyond your imagination!
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Visit me at ==> http://www.prodev.us





 





		
---------------------------------
 Start your day with Yahoo! - make it your home page 


More information about the AccessD mailing list