473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Search two tables and display results

Hi All

A tricky issue wonder if someone can help

I have two tables like this

TapeRecords

TapeID - Integer Primary key
Title - Text

TapeDetails

RecordId (Primary Key)
TapeId (related to the taperecords table)
ProgramDetails (Text)

The tape details table has a record of the programs that are stored on each
tape and each tape we have about 20 programs.

What i want my users it to allow them to search by programdetails and
display the list of tapes that match that search. I am not able to built a
query to search and display at the same time. Can someone help?

I am okay with ASP programming so if anyone has any suggestions or sample
code i will be pleased to hear from you.

Jan 18 '06 #1
2 2030
"JP SIngh" <no**@none.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi All

A tricky issue wonder if someone can help

I have two tables like this

TapeRecords

TapeID - Integer Primary key
Title - Text

TapeDetails

RecordId (Primary Key)
TapeId (related to the taperecords table)
ProgramDetails (Text)

The tape details table has a record of the programs that are stored on
each tape and each tape we have about 20 programs.

What i want my users it to allow them to search by programdetails and
display the list of tapes that match that search. I am not able to built a
query to search and display at the same time. Can someone help?

I am okay with ASP programming so if anyone has any suggestions or sample
code i will be pleased to hear from you.


This will search both the title and the description:

select taperecords.title
FROM taperecords, tapedetails
WHERE taperecords.tapeid= tapedetails.TapeId
AND
(taperecords.title LIKE '%searchstring%' OR tapedetails.ProgramDetails LIKE
'%searchstring%')

--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters
Jan 18 '06 #2
Well I'd suggest creating one SQL statement containing both tables
using an INNER JOIN or LEFT JOIN.

And as far as criteria goes hopefully these can help:

Classic ASP Design Tips - Search Criteria on Multiple Fields
http://www.bullschmidt.com/devtip-searchcriteria.asp

Classic ASP Design Tips - Search For Keywords on Multiple Fields
http://www.bullschmidt.com/devtip-se...iplefields.asp

Best regards,
-Paul
www.Bullschmidt.com - Freelance Web and Database Developer
www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

Jan 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
1
by: TH | last post by:
I am (still :) working on a recipe database. Now I am trying to figure out how to set it up for an ingredient search. What I want it to be able to do is three things: 1. Search based on just...
16
by: Andy_Khosravi | last post by:
I'm in a bit of a pickle. My employer, a health insurance firm, had me design a small database to track benefit issues. The intended users were technical specialists and some managers (about 90...
1
by: Matthew Curiale | last post by:
I am trying to create a search page for a database that will display in a repeater, using a stored procedure. The page_load is fine, and calls/displays all rows from the db just fine. When I input...
2
by: Arsalan Ahmad | last post by:
Hi, May be I am a newbie, or may be i dont have that much insight in following systems ..i.e. why i have some confusions as below: In many websites, when search is performed on some keywords...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
5
by: th1982 | last post by:
HI All I have a search page' s result which view 3results/per page,but my "next" link to view next page is not working. Here is my code : <?php // Get the search variable from URL ...
3
nathj
by: nathj | last post by:
Hi, I am just trying to develop a search system for my website. The PHP side of things is no trouble at all. I have also set up what I think are appropriate FULLTEXT indices on the tables I will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.