Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 15th, 2003, 12:59 PM
Authorized User
 
Join Date: Jul 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple Fields Search

sql="SELECT category,company,address,city,st FROM Category WHERE category LIKE '"&category&"%', WHERE company LIKE '"&company&"%'"

i try the above statement but of course it does not work, Im new at ASP so please can some one give me an idea how can i edit the above line to fix the search?

Thanks!

...helmut
__________________
...helmut
 
Old July 15th, 2003, 01:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

sql="SELECT category,company,address,city,st FROM Category WHERE category LIKE '" & category & "%' AND company LIKE '" & company &"%'"

Replace , WHERE
with
AND

...but the Soon is eclipsed by the Moon
 
Old July 15th, 2003, 02:17 PM
Authorized User
 
Join Date: Jul 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I didnt want to bring this question up, bc it seems so newbiesh.

in flash i do

if (a==1) && (b==2){
function();
}

but i cant find anything similar for ASP

If category<>"" & company<>"" Then

the above goes through without even testing for the if statements.

sorry if this too basic for this forum

...helmut
 
Old July 15th, 2003, 02:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

If category<>"" And company<>"" Then

...but the Soon is eclipsed by the Moon
 
Old July 15th, 2003, 02:47 PM
Authorized User
 
Join Date: Jul 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If category<>"" OR company<>"" Then


exactly!

...helmut





Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to Search Several Fields for the Same Keyword Eyrehead Access 3 March 16th, 2007 11:08 AM
retrieving fields,and using search button louie001 Beginning VB 6 0 October 11th, 2005 04:32 AM
Multiple Joins in Multiple Table Search query pookster Access 4 September 23rd, 2004 03:04 PM
Updating multiple Rows from multiple fields in ASP vdm_nana SQL Server ASP 0 April 1st, 2004 04:26 AM
mask of search with fields checkbox fdmfdm Access VBA 2 November 17th, 2003 02:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.