Print Page | Close Window

Select Where Help

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7452
Printed Date: 30 March 2026 at 12:16pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Select Where Help
Posted By: JoeP
Subject: Select Where Help
Date Posted: 21 November 2003 at 8:10am

Would someone assist me with a SELECT statement.  I have a variable MemID and I want to select records where TWO fields are tested for value in same table e.g.:

SELECT * From [tblMembers] WHERE [Arthor_ID]=" MemID

Works fine on one field test. Is There an OR command? So I can do something like:

 SELECT * From [tblMembers] WHERE [Arthor_ID]=" MemID & " OR WHERE [MemID]=" MemID  

TIA For any suggestions or guidance.

 



-------------
Quiz Fans - Do You Know Your http://www.houseofproctor.com/Arcades/Quiz/Pops/Dog/QA_Dog_Pop.asp - Dogs? / http://www.houseofproctor.com/Arcades/Quiz/Pops/Cat/QA_Cat_Pop.asp - Cats?



Replies:
Posted By: MorningZ
Date Posted: 21 November 2003 at 9:46am

If you are in Access:

SELECT * FROM [tblMembers] WHERE [Author_ID]= " MemID & " OR  [Author_ID] = & " OtherMemID

If you are in SQL, you can use the "IN" command

SELECT * From [tblMembers] WHERE [Author_ID] IN (" & MemID & ", " & OtherMemID & ")



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: JoeP
Date Posted: 21 November 2003 at 10:19am
Thank You!

-------------
Quiz Fans - Do You Know Your http://www.houseofproctor.com/Arcades/Quiz/Pops/Dog/QA_Dog_Pop.asp - Dogs? / http://www.houseofproctor.com/Arcades/Quiz/Pops/Cat/QA_Cat_Pop.asp - Cats?


Posted By: MorningZ
Date Posted: 21 November 2003 at 10:53am

just a note.. i noticed i mixed up the first SQL statement, this one is correct:

SELECT * FROM [tblMembers] WHERE [Author_ID]= " MemID & " OR  [Author_ID] = " & OtherMemID



-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net