Return Part of a text field
- From: "tdom" <tdom@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 23 Jun 2005 09:10:01 -0700
I have a table with a field named "swNotes". The field type is ntext. The
field can contain a variety of data. What I need to do is pull out just one
particular piece. Here is an example of 4 different rows of data in the
"swNotes" field:
--> Color = Green <-- --> Number = 1 <-- --> Notes = Today is Thursday. <--
--> Number = 25 <-- --> Notes = Hello <--
--> Weather = Hot <-- --> Notes = I need help. <-- --> Number = 567 <--
--> Color = Green <-- --> Notes = No number in this row. <--
My goal is to retrieve "Number = xxx".
So my returned data should be:
Number = 1
Number = 25
Number = 567
Null
Since "Number = " is not in the same position each time substring does not
work. And in some cases the "Number = xxx" is not provided.
Using Query Analyzer how can I complete this task?
Thanks.
.
- Follow-Ups:
- Re: Return Part of a text field
- From: Hugo Kornelis
- Re: Return Part of a text field
- Prev by Date: Insert non duplicate data
- Next by Date: Help with Query
- Previous by thread: Insert non duplicate data
- Next by thread: Re: Return Part of a text field
- Index(es):