Hello and thank you for the answer, analog.
The reason of the blank spaces in the DB is because the tables are part of a ERP, so the system stores the data of this field with leading and trailing spaces... my app is an external interface to that system, so i must adapt the code to the stored information.
the number of spaces are 4 if the number has one digit, and the spaces decreases as increases the digits of the number stored in the field:
1 -> four spaces
23 -> three spaces
957 -> two of them
1492
12345 -> no space
but i dont know the true reason of this design... maybe the blanks help in the internal report presentation?
i will try your suggest in the night and the i will share the results here, ok?
see you later, analog.