MANIPULATE FIELD VALUES

A

angie

i have a field (defined as text) which contains values in this format for
example: "VW-SP 5678AC".

i want to eliminate the first 5 digits (and following spaces, if any) of all
values contained in the field. in the example stated i want the query to
return "5678AC".

i have been trying to achieve that using the left function but it is not
working; but even if it were i do not think i would be able to eliminate any
spaces (if present) following the first 5 digits.

could you give me a hint?
 
G

Gijs Beukenoot

From angie :
i have a field (defined as text) which contains values in this format for
example: "VW-SP 5678AC".

i want to eliminate the first 5 digits (and following spaces, if any) of all
values contained in the field. in the example stated i want the query to
return "5678AC".

i have been trying to achieve that using the left function but it is not
working; but even if it were i do not think i would be able to eliminate any
spaces (if present) following the first 5 digits.

could you give me a hint?

I think:
Trim( Right( <field>, Len(<field>) - 5 ) )
Will do the job.
Trim = remove space from the beginning and the end (use Ltrim or Rtrim
if you want to restrict that to one side)
Right takes the right-side of the string, minus the first 5 characters.
 
Top