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!

Convert part of a string to int and do range comparison

Status
Not open for further replies.

elsenorjose

Technical User
Oct 29, 2003
684
US
In my database there is a table that stores URLs. In the URL there is a string that identifies a specific port in the form of: '
What I've been asked to do is identify ports that exist in certain ranges, for example between 1 and 100.

How would I extract just the numeric part of that string, convert it to int or other numeric so I can do a >=1 and <=100 query?

Thanks in advance.
 
So that's assuming the string I want is always in the same position? (from 53?) And if it's not, is it a nightmare to modify?
 
may i ask, is it always on the right, as the only thing on the right of the last colon? is port: the last url parameter?

if so, it's a lot easier

r937.com | rudy.ca
 
Thank you both. I'll look at the instr function.

Rudy, port isn't the last parameter. I should have given a better example. You typically see additional values after that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top