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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADVANCED ORDERING

Status
Not open for further replies.

Silvinho

Programmer
Jul 9, 2001
58
0
0
GB
I’m having a problem which I’m not sure is even achievable.

I’ve created a search results page that works normally i.e.:

strSearch = Request.Form(“search”)

SELECT * FROM Table1 WHERE Field1 LIKE ‘%strSearch%’


Say the form variable is ‘Dog’

What I want to achieve is to count the number of times the variable ‘Dog’ appears in the search.

The ultimate aim was to order the query by the number of times the variable appeared so this might not be the best way to do this but I cant think of anything better for now.

Anyway any help would very helpful.
 
do you mean
SELECT count(*) FROM Table1 WHERE Field1 LIKE '&"%strSearch"%&'"

_________________________________________________________
for the best results to your questions: FAQ333-2924
[sub]01001111 01101110 01110000 01101110 01110100[/sub]
onpnt2.gif
[sup] [/sub]
 
my quotes are messed up again [smile]
LIKE '%" & strSearch & "%'"

_________________________________________________________
for the best results to your questions: FAQ333-2924
[sub]01001111 01101110 01110000 01101110 01110100[/sub]
onpnt2.gif
[sup] [/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top