Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Help with code to filter through database.
Old 05-06-2006, 08:21 AM Help with code to filter through database.
Skilled Talker

Posts: 79
Trades: 0
Hey there, I have the following code that works just fine, but I would like for it to filter/search through another category.

"SELECT SupplierName, Location, ShortDescription, TimberSpecies, CategoryTitle, Country
FROM Query1
WHERE TimberSpecies LIKE '%" + Replace(rsSearchResult__MMColParam, "'", "''") + "%' AND CategoryTitle LIKE '%" + Replace(rsSearchResult__MMColParam2, "'", "''") + "%' AND Location LIKE '%" + Replace(rsSearchResult__MMColParam3, "'", "''") + "%'
ORDER BY SupplierName"


In this code I would like for the search to also search all customers with the "Retail-Trade" category. "Wholesale" I want to exclude.

Table Name: Query1
Column Name: BusinessType
Record or Category Names: Retail-Trade & Wholesale.


Is this possible with the code I have supplied?

Thanks again.

Mally.

Last edited by malhyp; 05-06-2006 at 08:59 AM..
malhyp is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-08-2006, 01:43 AM Re: Help with code to filter through database.
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
WHERE TimberSpecies LIKE '%" + Replace(rsSearchResult__MMColParam, "'", "''") + "%' AND CategoryTitle LIKE '%" + Replace(rsSearchResult__MMColParam2, "'", "''") + "%' AND Location LIKE '%" + Replace(rsSearchResult__MMColParam3, "'", "''") + "%' And BusinessType = 'Retail-Trade'

That should do it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-08-2006, 10:22 AM Re: Help with code to filter through database.
Skilled Talker

Posts: 79
Trades: 0
Thanks Adam, it worked perfectly.

TA

Mally.
malhyp is offline
Reply With Quote
View Public Profile
 
Old 05-08-2006, 11:42 AM Re: Help with code to filter through database.
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
No problem.

You can add as many conditions as you want to an SQL query after the first one by using the "And (condition)" syntax.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Help with code to filter through database.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56896 seconds with 12 queries