searching through results

J

Joey Martin

I know how to use the LIKE command in a query but how do I do it in the
results of a recordset?

results="<b>Hello</b> World"

I want to search the above result and if it has a <B> in it, I want set
hasabold="Y"
I need to be able to search through a large amount of text so the BOLD marks
will not always be at the front of the results. They maybe be on line 50
character 59, etc....
 
A

Aaron Bertrand - MVP

Why don't you do it from the query?

It helps if you tell us which database you're using (see
http://www.aspfaq.com/5009), but for SQL Server:

SELECT hasabold = CASE WHEN CHARINDEX('<b>', column)>0 THEN 'Y' ELSE 'N'
END,
<otherstuff> FROM table
 
J

Joey Martin

Let me be more clear so as not to be confusing.

I am actually importing a text file. I am reading the lines and they are
goin into "sections".
For example section A may read: This is a test and it has a bold <b>
right</b> here.

It typically includes 10-20 lines of text.
I just need to look through that Section A and if it has a bold, mark it as
such use sectionabold=Y
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,838
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top