SunQuest
           MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

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 Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old June 10th, 2004, 05:34 AM
mooliMooli mooliMooli is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Western Australia
Posts: 36 mooliMooli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 6 sec
Reputation Power: 5
Simple SQL statement with checkboxes

Hi,

Just need a little help with a simple SQL statement.

I have a database which includes a field entitled 'DOC_TYPE'. There are currently four different document types stored under this field.

I have a search form which allows users to search on one particular document type by entering a keyword into a textfield - so they get all the document types which include that keyword in another field.

ie

SELECT * FROM myTable WHERE 'DOC_TYPE' = 'type01' AND ((field1 LIKE 'myVariable') OR (field2 LIKE 'myVariable) etc

With this method I would have to have four different search forms to allow users to search on the four different document types.

Obviously the better way to do it would be to have 4 checkboxes, one for each document type, accompanied by a texfield in which the user enters a keyword to filter the document types.

The problem is, I have no idea how to incorporate 4 checkboxes in this statement.

Can anyone help.

Many thanks,

mM

Reply With Quote
  #2  
Old June 10th, 2004, 07:39 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,344 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 8 h 27 m 14 sec
Reputation Power: 891
this is not a sql server question

i'm a forum admin, and would be happy to move your question to the appropriate forum -- asp? jsp? coldfusion? php?
__________________
r937.com | rudy.ca

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Simple SQL statement with checkboxes


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway