A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filter for Same Value in Two Fields



 
 
Thread Tools Display Modes
  #11  
Old November 28th, 2009, 09:33 PM posted to microsoft.public.access.queries
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Filter for Same Value in Two Fields

Do you mean AND or OR? We often use AND in everyday English when we really
mean a Boolean OR. Using AND here would return only those items which are
shipped from Denver to Denver because the value is the same in both columns.
That sounds less likely, so I think you probably want an OR, items shipped
from Denver or items shipped to Denver. So the query would be something like:


SELECT *
FROM [YourTable]
WHERE [From] = "Denver"
OR [To] = "Denver";

In query design view an OR operation is built when you include the value on
the first and second criteria row of the design grid respectively for each
column, e.g. you'd put "Denver" in the first criteria row of the From column
and in the second criteria row of the To column; or vice versa, the result is
the same.

Putting "Denver" in the first criteria row of both columns would build a
Boolean AND operation, i.e. items shipped from Denver to Denver.

Ken Sheridan
Stafford, England

Dave wrote:
There are two fields in my query. "From" and "To". For sake of ease, let's
say both these fields are US Cities. How can I pull all the records that show
shipped "From" Denver and that show shipped "To" Denver? Thank you in advance.


--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.