What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » SQL/Database Help

SQL/Database Help
Author: Message:
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
38 / Male / Flag
Joined: Mar 2006
O.P. SQL/Database Help
Okay, I have a database of films.....I want a search function to be able to find any films that a given pair of actors appear in (Owen Wilson & Ben Stiller, for example) when they could be in any one of the 4 "Actor" fields.

Here's the code I have:

sql code:
SELECT tblFilms.ID, tblFilms.Title, tblFilms.Year, tblFilms.Actor1, tblFilms.Actor2, tblFilms.Actor3, tblFilms.Actor4
FROM tblFilms
WHERE (((tblFilms.Actor1)=[Enter the first actor who's films you would like to find] Or (tblFilms.Actor1)=[Enter the second actor who's films you would like to find])) OR (((tblFilms.Actor2)=[Enter the first actor who's films you would like to find] Or (tblFilms.Actor2)=[Enter the second actor who's films you would like to find])) OR (((tblFilms.Actor3)=[Enter the first actor who's films you would like to find] Or (tblFilms.Actor3)=[Enter the second actor who's films you would like to find])) OR (((tblFilms.Actor4)=[Enter the first actor who's films you would like to find] Or (tblFilms.Actor4)=[Enter the second actor who's films you would like to find]));

That's the closest I could get.....but as you'll know, that finds any film which EITHER actor was in.  My SQL knowledge isn't good enough to figure out how to get it to work properly, but I'm sure it'll be easy enough for someone who knows what they're doing!

Thanks
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5426 days, 7 hours, 48 minutes, 10 seconds ago
03-18-2010 06:42 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
SQL/Database Help - by djdannyp on 03-18-2010 at 06:42 PM
RE: SQL/Database Help - by Mnjul on 03-18-2010 at 06:52 PM
RE: SQL/Database Help - by djdannyp on 03-18-2010 at 07:02 PM
RE: SQL/Database Help - by Mnjul on 03-18-2010 at 07:05 PM
RE: SQL/Database Help - by djdannyp on 03-18-2010 at 07:18 PM
RE: SQL/Database Help - by toddy on 03-18-2010 at 07:42 PM
RE: SQL/Database Help - by djdannyp on 03-18-2010 at 07:56 PM
RE: SQL/Database Help - by matty on 03-18-2010 at 08:06 PM
RE: SQL/Database Help - by djdannyp on 03-18-2010 at 08:09 PM
RE: SQL/Database Help - by matty on 03-18-2010 at 08:17 PM
RE: SQL/Database Help - by toddy on 03-18-2010 at 08:17 PM
RE: SQL/Database Help - by matty on 03-18-2010 at 08:19 PM
RE: SQL/Database Help - by toddy on 03-18-2010 at 08:31 PM
RE: SQL/Database Help - by Adeptus on 03-19-2010 at 09:23 AM
RE: SQL/Database Help - by djdannyp on 03-19-2010 at 09:47 AM
RE: SQL/Database Help - by CookieRevised on 03-20-2010 at 10:28 AM
RE: SQL/Database Help - by djdannyp on 03-20-2010 at 10:49 AM
RE: SQL/Database Help - by CookieRevised on 03-20-2010 at 11:23 AM
RE: SQL/Database Help - by Adeptus on 03-20-2010 at 11:26 AM
RE: SQL/Database Help - by djdannyp on 03-20-2010 at 12:38 PM
RE: SQL/Database Help - by CookieRevised on 03-20-2010 at 04:45 PM
RE: SQL/Database Help - by djdannyp on 03-20-2010 at 07:08 PM
RE: SQL/Database Help - by CookieRevised on 03-20-2010 at 10:28 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On