Forums

This topic is locked

Partial Text Search

Posted 08 Feb 2003 00:22:58
1
has voted
08 Feb 2003 00:22:58 John Levandowski posted:
Hey y'all! I'm trying to create a search that uses wildcards to allow for a user to only know part of a name. I got it to work when you know the whole name but not just part of it. Every time I add the wild card marks either dreamweaver or the browser doesn't like where I put them or it doesn't work. This is what I have so far
as my statement in the results page:
SELECT [catalog].[REG_NUMBER], [catalog].[TITLE], [catalog].[YEAR], [catalog].[MEDIUM], [catalog].[DESCRIPTION], [catalog].[IMAGE], [lots].[LOT_NUMBER]
FROM lots RIGHT JOIN [catalog] ON [lots].[REG_NUMBER] =[catalog].[REG_NUMBER]
WHERE catalog.TITLE LIKE ?

where the parameter TITLE = IIf((Request.QueryString("Title" <> Nothing), Request.QueryString("Title", ""

Where do the %'s go? Or is it on the search page?

Thanks!

John

Replies

Replied 08 Feb 2003 18:24:00
08 Feb 2003 18:24:00 Dennis van Galen replied:
WHERE catalog.TITLE LIKE '%?%'

HTH

with regards,

Dennis van Galen
Webmaster KPN Telecom Holland
Financial & Information Services

Studio MX / CFMX PRO / SQL 2000 / NT4 AND win2kPRO / IIS5

Edited by - djvgalen on 08 Feb 2003 18:24:29
Replied 10 Feb 2003 16:29:05
10 Feb 2003 16:29:05 John Levandowski replied:
I tried '%?%' and I get the response "Invalid syntax near '(value tested for)'."

Any thoughts?

John
Replied 10 Feb 2003 18:09:22
10 Feb 2003 18:09:22 Dennis van Galen replied:
John,

Can you try this:

TITLE = IIf((Request.QueryString("Title" <> Nothing), Request.QueryString("%Title%", ""


with regards,

Dennis van Galen
Webmaster KPN Telecom Holland
Financial & Information Services

Studio MX / CFMX PRO / SQL 2000 / NT4 AND win2kPRO / IIS5
Replied 10 Feb 2003 18:09:46
10 Feb 2003 18:09:46 Brent Colflesh replied:
Dear John,
Is this an Access db? Try the asterisk (*) instead.

Regards,
Brent

Replied 10 Feb 2003 23:50:58
10 Feb 2003 23:50:58 John Levandowski replied:
I tried both *'s and %'s as suggested by y'all and it still won't cooperate. Is there a (gulp) more complicated way of doing this in order for it to work?

<Parameter Name="Title" Value='<%# IIf((Request.QueryString("Title" <> Nothing), Request.QueryString("*Title*", ""

Thanks

John

Reply to this topic