-
SQL search statement
I am in the middle of creating a database search page for a web site...
I was wondering if an *(asterix) can be used as part of the LIKE section
i.e.
SELECT description, url, title FROM tblURL WHERE description =
* & txtsearchstring & *
would this filter out the selected fields that has the search string in the
"descrition" field....
any help would be appreciated
David M
-
Re: SQL search statement
I would suggest using the 'like' operand in your SQL statement:
SELECT description, url, title FROM tblURL WHERE description like
% & txtsearchstring & %
HTH ... Matt
"David M" <d_mcgillivray@lineone.net> wrote:
>
>I am in the middle of creating a database search page for a web site...
>
>I was wondering if an *(asterix) can be used as part of the LIKE section
>
>i.e.
>
>SELECT description, url, title FROM tblURL WHERE description =
>* & txtsearchstring & *
>
>would this filter out the selected fields that has the search string in
the
>"descrition" field....
>
>any help would be appreciated
>
>David M
>
-
Re: SQL search statement
"David M" <d_mcgillivray@lineone.net> wrote:
>
>I am in the middle of creating a database search page for a web site...
>
>I was wondering if an *(asterix) can be used as part of the LIKE section
>
>i.e.
>
>SELECT description, url, title FROM tblURL WHERE description =
>* & txtsearchstring & *
>
>would this filter out the selected fields that has the search string in
the
>"descrition" field....
>
>any help would be appreciated
>
>David M
>
David,
Nope, it does not like *'s it prefers % - hope this helps!
Leonard
-
Re: SQL search statement
"David M" <d_mcgillivray@lineone.net> wrote:
>
>I am in the middle of creating a database search page for a web site...
>
>I was wondering if an *(asterix) can be used as part of the LIKE section
>
>i.e.
>
>SELECT description, url, title FROM tblURL WHERE description =
>* & txtsearchstring & *
>
>would this filter out the selected fields that has the search string in
the
>"descrition" field....
>
>any help would be appreciated
>
>David M
>
I just experienced a similar problem myself. Try using % instead of *
Bill
-
Re: SQL search statement
Bill is correct use %
"Bill" <Bill@neropes.com> wrote:
>
>"David M" <d_mcgillivray@lineone.net> wrote:
>>
>>I am in the middle of creating a database search page for a web site...
>>
>>I was wondering if an *(asterix) can be used as part of the LIKE section
>>
>>i.e.
>>
>>SELECT description, url, title FROM tblURL WHERE description =
>>* & txtsearchstring & *
>>
>>would this filter out the selected fields that has the search string in
>the
>>"descrition" field....
>>
>>any help would be appreciated
>>
>>David M
>>
>
>I just experienced a similar problem myself. Try using % instead of *
>
>Bill
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks