From the course: Access 2007: Shortcuts

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Using IN instead of OR

Using IN instead of OR - Microsoft Access Tutorial

From the course: Access 2007: Shortcuts

Start my 1-month free trial

Using IN instead of OR

When you're writing an Or query with multiple values, sometimes using the In is better than using Or. You can use the In operator when you need to determine whether a value equals one of many values. Right now I am in the In State query and let's got to Design view. I'll hold my cursor between State and WorkPhone to get a double-headed arrow and double-click to expand it out. So here, I'm looking for customers within a set of states, and this criterion expression uses several Or operators; CA Or NV Or NM Or AZ Or MD or PA. A simple alternative is to use the In operator. I'll click in the line below and I'll type In, and then an open parenthesis, and then I'll list my states. CA, NV, NM, AZ, MD, and PA, and I'll finish with a closing parenthesis. When I hit Tab, notice that Access will even type in the quotation marks for me so that I don't have to do it myself. Notice how much shorter an In statement is than an Or statement? I'll take out the original Or statement and when I run the…

Contents