SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL 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 ASP Free Forums Sponsor:
  #1  
Old September 21st, 2000, 04:52 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Help for SQL-Query

<i><b>Originally posted by : Guenter Podgornik (guenter.podgornik.borgg@schulen.vol.at)</b></i><br /><br />I have an access database with two tables (author [AuthorID,FirstName, SecondName, Birth, Biography], books [AuthorID, Title, Synopsis, Characters, Appreciation]) that are linked by the key "authorID".<br /><br />I've linked the database to my website. There is the option to search for FirstName, SecondName and Title. I have no problem to figure out the SQL command (for the command object) for finding the results if only one of the three boxes are used. But I don't know how to write a query so that a user my fill in letters in two or all three boxes and then you get the inner join of the two resp. all three.<br /><br />BTW, queries should not be process if less than three letters are filled in.

Reply With Quote
  #2  
Old November 7th, 2000, 03:11 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : iyyappan n iyer (iyyappan_n_i@hotmail.com)</b></i><br /><br /><br /><br />------------<br />Guenter Podgornik at 9/21/2000 1:52:55 PM<br /><br /><br />I have an access database with two tables (author [AuthorID,FirstName, SecondName, Birth, Biography], books [AuthorID, Title, Synopsis, Characters, Appreciation]) that are linked by the key "authorID".<br /><br />I've linked the database to my website. There is the option to search for FirstName, SecondName and Title. I have no problem to figure out the SQL command (for the command object) for finding the results if only one of the three boxes are used. But I don't know how to write a query so that a user my fill in letters in two or all three boxes and then you get the inner join of the two resp. all three.<br /><br />BTW, queries should not be process if less than three letters are filled in.<br /><br />'****firstname search<br /><br />if not isempty(request.querystring("firstname") and isempty(request.querystring("secondname") and isempty(request.querystring("title") then<br />'search on firstname only<br />end if<br /><br />'second name only<br />if isempty(request.querystring("firstname") and not isempty(request.querystring("secondname") and isempty(request.querystring("title") then<br />'search on second only<br />end if<br /><br />'title only<br />if isempty(request.querystring("firstname") and isempty(request.querystring("secondname") and not isempty(request.querystring("title") then<br />'search on title only<br />end if<br /><br />'first and second name<br />if not isempty(request.querystring("firstname") and not isempty(request.querystring("secondname") and isempty(request.querystring("title") then<br />'search on firstname and second name only<br />end if<br /><br />'firstname,secondname and title search<br />if not isempty(request.querystring("firstname") and not isempty(request.querystring("secondname") and not isempty(request.querystring("title") then<br /><br />'search on all 3 fields<br />end if<br /><br />'similarly for other combinations like, first and title,sedond title<br /><br />'*********there are even more complex ways of doing this using string joins , try the above, fir the time being

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Help for SQL-Query


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 3 hosted by Hostway
Stay green...Green IT