View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default Split Field content in Query?

I have a filed for which the number of characters is not fixed
containg data in the format xxxx/xxxxxxx

I want to get only the right side of the "/" only in a field. The
number of characters after "/" is not fixed.


Abdul:

SELECT mid(tblTester.Field1,instr(tblTester.Field1,'/')+1,255) AS
'RightSide'
FROM tblTester

where the field is Field1, the table is tblTester and the name you want to
return is RightSide. The mid function is used to return part of a string
and the instr function will tell you the position of '/' in your string.

--
Dick Kusleika
MVP-Excel
www.dailydoseofexcel.com