472,805 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Is there an "In" expression?

Hello,

I was looking at a Access query and noticed in the criteria it stated:

In ('001','002')

Can someone please explain what the In is? How does it different from
Or?

Thank you,

Brian

Nov 13 '05 #1
4 1258
BerkshireGuy wrote:
Hello,

I was looking at a Access query and noticed in the criteria it stated:

In ('001','002')

Can someone please explain what the In is? How does it different from
Or?


It would be the same as:

ID = '001' or ID = '002'

It's just an easier way of doing multiple ORs.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2
BerkshireGuy wrote:
In ('001','002')

Can someone please explain what the In is? How does it different from
Or?


Same as using or.

I don't know about Jet, but in Oracle, the SQL performance tuning texts
I have indicate it's a preferred syntax to using "or".

I also find in Jet or Oracle, it makes it easier for me, anyway, to
write SQL via VBA code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3
DFS
MGFoster wrote:
BerkshireGuy wrote:
Hello,

I was looking at a Access query and noticed in the criteria it
stated:

In ('001','002')

Can someone please explain what the In is? How does it different
from Or?


It would be the same as:

ID = '001' or ID = '002'

It's just an easier way of doing multiple ORs.


It has additional functionality that can be handy: when used within the
PIVOT clause of a crosstab query, it will restrict the query output to and
force the output of only those columns listed in the "In ('val1',
'val2',...)" statement.
Nov 13 '05 #4
Tim Marshall wrote:
BerkshireGuy wrote:
In ('001','002')

Can someone please explain what the In is? How does it different from
Or?

Same as using or.

I don't know about Jet, but in Oracle, the SQL performance tuning texts
I have indicate it's a preferred syntax to using "or".


ISTR this was true in Access as well, dunno about now they keep changing
things :-)

--
This sig left intentionally blank
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ronald W. Roberts | last post by:
I'm not sure where this routine came from, but here is the problem. On certian computers this error occurs, but it does not on others. The error is: "Undefined Function "DIR" in expression". ...
10
by: LaEisem | last post by:
On-the-job, I have "inherited" a lot of old C language software. A question or two about when "casting" of null pointer constants is needed has occurred during behind-the-scenes cleanup of some...
4
by: Diogo Alves - Software Developer | last post by:
I have the following code line: dsEmps.Tables.Columns.Expression = "MonthlyDeviation%60"; but hits gives an error it says that can't MOD from System.Double to System.Int32 I tried to put the...
2
by: John Smith | last post by:
My understanding is that to search for "big" OR "small" in a string, one uses the following expression: r = New Regex("big|small", _ RegexOptions.IgnoreCase Or RegexOptions.Compiled) What is...
4
by: michael.bollhoefer | last post by:
I am trying to split a string into two different variables. The string is pulled from an XML file from a WEBDAV program. The string will be in this form "John Doe" <john.doe@webserver.com> ...
77
by: M.B | last post by:
Guys, Need some of your opinion on an oft beaten track We have an option of using "goto" in C language, but most testbooks (even K&R) advice against use of it. My personal experience was that...
6
by: blackdogharry | last post by:
Hi, I am a novice VBA user. My access version is 2007 on Windows XP PC. I need to create a query that will take pre-existing text values of the B_status field (such as "Received_Emailed",...
2
by: rmmahara | last post by:
Hi Folks, I've been reading these forums for a while and now I'm in desperate need of help, so I thought I'd post! Background: I'm creating a Service Dashboard to track my team's adherence...
4
by: fran7 | last post by:
Hi, from help in the javascript forum I found the error in some code but need help. This bit of code works perfectly, trouble is I am writing it to a javascript function so the height needs to be in...
6
by: Russ P. | last post by:
I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends with a "+", for...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.