473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

I need a substring query that will return certain values from a character string

Table URL_3 consist of the following 2 columns of information being Record No and URL

Expand|Select|Wrap|Line Numbers
  1. No                         URL
  2. 1   http:/publishing/45/100006_f.SAL_Local.html
  3. 2   http:/publishing/45/100006_f.SAL_Area.html
I need a substring query that will return the values of Local and Area from column URL of Table URL_3 into an additional column of information.
I was looking for the solution, shown below, that tried to delimit the desired values of the underscore(_) and the period(.) that preceeded and followed the desire values of Local and Area that I was trying to extract. I could not get this query to work and was hoping it could be made to work. I would appreciate any solution to this problem

Expand|Select|Wrap|Line Numbers
  1. SELECT Right([url],InStr([url],_  .)-1) 
  2. FROM URL_3;
Sep 20 '10 #1
2 1707
NeoPa
32,556 Expert Mod 16PB
Try :
Expand|Select|Wrap|Line Numbers
  1. SELECT [No]
  2.      , [url]
  3.      , Mid([url], 
  4.            InStr(1, [url], 'SAL_') + 4, 
  5.            InStr(1, [url], '.html') -
  6.            InStr(1, [url], 'SAL_') - 4) AS URLBit
  7. FROM   [URL_3]
Sep 20 '10 #2
Mariostg
332 100+
Under the assumtions that it is either Area or Local, the following could work too:
Expand|Select|Wrap|Line Numbers
  1. SELECT IIf(InStr(URL,"Local"),"Local","Area") AS MyString
  2. FROM URL_3;
  3.  
Sep 20 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Bill | last post by:
Hello out there; This may be a challenge but I'm certain it's possible but I can't seem to figure out how. I have a table that has several date fields, e.g., Date1, Date2, Date3, Date4 ......
25
by: lovecreatesbeauty | last post by:
Hello experts, I write a function named palindrome to determine if a character string is palindromic, and test it with some example strings. Is it suitable to add it to a company/project library...
1
by: izziy | last post by:
Our legacy DB has a bad column which stores a date value as char(8), it has a format like 'MMDDYYYY'. I am creating a report to report this particular date and also use this date to specify a...
7
by: supertsik | last post by:
Hi After a lot of research I didn't manage to solve the following problem: I have a table called 'Autos' with fields , , 1 ¦ Mike ¦ BMW 2 ¦ Mike ¦ Ford 3 ¦ Mike ¦ Toyota 4 ¦ Nick ¦ Audi
2
by: jennk | last post by:
i am working in Access 97, our database tables are linked from ODBCsqlsvr (not even sure what that means). i have a table where each record has a unique customer and their order information. there...
7
by: Robert Johnson | last post by:
Hi all. Checked the docs and all I can find is UCase but that will convert everything to upper. What I want is when my users enter say a name into a text box I want to just upper the first char for...
1
by: Mandrakeooi | last post by:
Hi, Is there anyway to query 7 table from MSSQL , If any of the table consist of 0 then the value 0 is return. If all 7 table dont consist 0 value in the table, value 1 is return Regards...
7
by: enrico via DotNetMonster.com | last post by:
i'm using mySQL as my backend to my program. i know this is not VB.NET anymore but i don't know how to do it. i have a query that will calculate if it satisfies the condition. it goes like this: ...
4
bugboy
by: bugboy | last post by:
Hi, I need to remove the return characters from a string but i can't figure out how to reference it in a replace() method. this.value=this.value.replace(/char(13)/, ""); Also when i test the...
12
by: KPR1977 | last post by:
In an Access Database for field2, the data values could consist of the following: ---field1-------------field2------- Widget 1-----112398764567 Widget 2-----987611236789 Widget...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.