ASP

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentASP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old April 19th, 2013, 07:13 AM
rickg rickg is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Apr 2013
Posts: 2 rickg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 sec
Reputation Power: 0
Need Help with ASP Select Statement

I have a web page that has three textboxes. A user can type into all three text boxes to search for our inventory. I am using an old version of Dreamweaver MX 2004 but that should not matter.

The user types in the following:
Textbox1: wsfm
Textbox2: 2k
Textbox3: 50ppm

My select statement is:
SELECT *
FROM ESCInv
WHERE ProdSearchDesc LIKE '%Search_Criteria'
AND ProdSearchDesc LIKE '%Search_Criteria2'
OR ProdSearchDesc LIKE '%Search_Criteria3'

The results are:
EFI WSFM 2K 50PPM
EFI WSFM 91K 50PPM

The resuts should be:
EFI WSFM 2K 50PPM

If I change the select statement to:
SELECT *
FROM ESCInv
WHERE ProdSearchDesc LIKE '%Search_Criteria'
AND ProdSearchDesc LIKE '%Search_Criteria2'
AND ProdSearchDesc LIKE '%Search_Criteria3'

The results are NONE. It returns NO items.

What is wrong with this Select statement???

Or is there an easy way to use just one textbox and allow the user to do a multi-word search of the column in my table?????

Thank you...
Rick G

Reply With Quote
  #2  
Old April 23rd, 2013, 01:03 AM
samuelblack samuelblack is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Apr 2013
Posts: 7 samuelblack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 53 sec
Reputation Power: 0
answer select statement

You should add enclose the or condition in round bracket
it should be like this,

FROM ESCInv
WHERE ProdSearchDesc LIKE '%Search_Criteria'
AND (ProdSearchDesc LIKE '%Search_Criteria2'
OR ProdSearchDesc LIKE '%Search_Criteria3')

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentASP > Need Help with ASP Select Statement


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap