PARSEING A FIELD

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

THIS IS A EXAMPLE OF FIELD VALUE AND WHAT I WANT AS
RESULTS. I WANT TO SEPARATE WHAT AFTER THE LAST OCCURENCE
OF A HYPHEN IN THE FIELD. ANY IDEAS

A-1 1
A-10R-1OL-1 1
A-10R-10R-1R-1 1
A-3R-2 2
A-4R-2L-2 2
 
In the example listed below, it looks as though you are retrieving the last character of every value. If this is the case use the formula, RIGHT([FieldName),1).


----- (e-mail address removed) wrote: -----

THIS IS A EXAMPLE OF FIELD VALUE AND WHAT I WANT AS
RESULTS. I WANT TO SEPARATE WHAT AFTER THE LAST OCCURENCE
OF A HYPHEN IN THE FIELD. ANY IDEAS

A-1 1
A-10R-1OL-1 1
A-10R-10R-1R-1 1
A-3R-2 2
A-4R-2L-2 2
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Acc2002:

SELECT Mid(ColumnName, InStrRev(ColumnName, "-") + 1)
FROM TableName
WHERE ...

If there isn't a "-" in the string the whole string will be returned.

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQBK2DoechKqOuFEgEQLMNQCfW94FEicc/RwTzJ9z1i7GzKcjyMEAoJOk
sRj2Baf9+XqykDQE673jvrF4
=48fd
-----END PGP SIGNATURE-----
 
Back
Top