I have a field in an imported text file that should ideally be a number field but has preceding zeroes (e.g. 000000004800). I had to make this a text field on import as some of the fields have hyphens (-) in the middle (e.g. 0000000-9000), which meant that, if I selected a number data type, certain field values were thrown out.
My idea is to write a query and replace the hyphen with a zero and then to either remove the zeroes or convert to a number.
However, my initial step of replacing the hyphen with a zero
Expr1: Replace([FieldName],"-","0")
is giving me the error message of “data type mismatch in criteria expression”, which I do not understand as it is a text field and I have successfully used this in other text fields before.
Any help as to how to proceed would be appreciated.
My idea is to write a query and replace the hyphen with a zero and then to either remove the zeroes or convert to a number.
However, my initial step of replacing the hyphen with a zero
Expr1: Replace([FieldName],"-","0")
is giving me the error message of “data type mismatch in criteria expression”, which I do not understand as it is a text field and I have successfully used this in other text fields before.
Any help as to how to proceed would be appreciated.