| Author |
Search two tables and display results
|
|
| JP SIngh 2006-01-18, 6:56 pm |
| 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.
| |
| John Blessing 2006-01-18, 6:56 pm |
| "JP SIngh" <none@none.com> wrote in message
news:%237Ll7lDHGHA.4036@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
| |
|
|
|
|