Splits field at end in querying

P

Piere Garmond

Hellow Mr and Mrs

I have text field in table like
qw-e-rrrt-yu ty-,yy-q
and as well like
s-sd--dfe-frr-fr-vb-rew
and
cf-cfcf--e-rr-thk

Please can tell you to me how I can complete in a query to take away all
item previous and after last -
as above samples will be
Answer 1
qw-e-rrrt-yu ty-,yy
Answer 1B
-q

Answer 2
s-sd--dfe-frr-fr-vb
Answer 2B
-rew

Answer 3
cf-cfcf--e-rr
Answer 3B
-hk

The itimising I have show are from metalurgic (from metals) references.

I like to make 2 calculated colms with
evertything "before" the last "-"
and a other with everythink "after and includes" last "-"

I await with thanks for your assisstance
 
K

Klatuu

To get the part before the last -

SELECT Left(MyField, Instrrev(MyField,"-")-1) As LeftPart

And the right part:

Mid(MyField,Instrrev(MyField,"-"))
 
Top