General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>
>>You will get 4 with an Integer type field because an integer is store as a 4-byte binary value. If you want the number of digits stored in a integer type field you might try Len(AllTrim(Str(fieldname))). This will get the number of digits.
>>
>>Hope this helps.
>
>Yes this works. But now I remember why I did not use this: I loose the decimals in this case. Some fields have decimals (normally two), others not. How can I determine whether a field has decimals? When I know this, I can use STR(fieldname,NrOfDecimals) and the problem is solved.
An Integer Type field will never have decimals. If you are not sure if the field you want the length of has decimals or not you will need to do an AFIELDS() to get the field names and information into an array. Column 3 will give you the length and column 4 will give you the decimal places. Note that currency is always stored with 4 decimal places.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only