ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Split Field content in Query? (https://www.excelbanter.com/excel-programming/360157-split-field-content-query.html)

Abdul[_2_]

Split Field content in Query?
 
Hi All,

Is it possible to get part of data in a field using 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.

Any help please?

thanks


Don Guillett

Split Field content in Query?
 
Have a look in vba help for INSTR and MID

--
Don Guillett
SalesAid Software

"Abdul" wrote in message
oups.com...
Hi All,

Is it possible to get part of data in a field using 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.

Any help please?

thanks




Dick Kusleika[_4_]

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




All times are GMT +1. The time now is 03:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com