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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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 | |
|
|