Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query

Status
Not open for further replies.

masalachol

Technical User
Apr 8, 2004
20
US
In a table I have a column called Branch_Number and it looks like the example below.
ie:
Branch_Number
1111111/2222222
3333333/5555555

Using a query I would like to just capture the values right of the "/" forward slash character {2222222,5555555 from the Branch_Number column .

Any suggestions?

 
SELECT RIGHT(BRANCH, InStr('/', BRANCH)) From tablename

I may have the syntax of the InStr wrong!
It may be

InStr(BRANCH, '/')

Leslie
 
try something like this:

Code:
SELECT MID(Branch_Number, 8)
FROM tablename....

< M!ke >
 
I was right that I was wrong! It should be as follows:

Right(BRANCH, InStr(BRANCH, "/") + 1)

Leslie
 
Well, I guess I should just call it a day, I obviously am WORTHLESS today!! I must have left my brain in the weekend since I don't have it here!

les
 
I've made that same mistake, often. It just feels right to say Right("howdy",2) starts from the "o", so I've done this a few times before. Anyway, take a break, stretch, walk around, get some sun/air, you'll feel better.

Pete
 
GREAT suggestions!! and the

Mid(BRANCH, InStr(BRANCH, "/") + 1) and
SELECT MID(Branch_Number, 8)

worked!!

=======

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top