Forum Moderators: open

Message Too Old, No Replies

ASP Classic Database looping

         

traeanthony

6:01 pm on Sep 21, 2008 (gmt 0)

10+ Year Member



I'm trying to display information from a database on a webpage using asp classic. The issue is, I have a field that has various data in it, I need to search through the data in that field to find a specific number and then display it on the site. Also the number may be repeated so I need it to display all results from the query.

So in other words I have table_tbl with fld_1 fld_2 and fld_3. fld_3 will have numbers in it for example 1, 2, 3, 2 in different record sets. I need to beable to search for (example) "2" and desplay all resulting recordsets. Any clues?

Ocean10000

5:11 am on Sep 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Example of the sql query. You will need to replace the search value, but should give you an idea how to search.

select fld_1, fld_2, fld_3
from table_tbl
where fld_3 like '%2%';

I am going to assume fld_3 is a text/string datatype for the search.

traeanthony

5:18 pm on Sep 22, 2008 (gmt 0)

10+ Year Member



Thank you I have that part set up and it's pulling those fields, but, the problem is now there are four record sets, two have the value of "2". It loops through the selected record sets but displays both of them 4 times (I'm assuming because there are 4 record sets) is there any way to limit this?

webworker us

2:03 am on Sep 28, 2008 (gmt 0)

10+ Year Member



Can you combine the recordsets or are you pulling from 4 different databases?

Casey