473,320 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

OR statement in Access

31
Is there a way to the an OR statement when doing "If, than" statements in Access. I know how to do it in Excel, but can't seem to do in in Access.

Example: iff ([a] or [b] >1,"Yes", "No")


Thank you for any direction you can provide.

A
Mar 6 '09 #1
2 29888
Stewart Ross
2,545 Expert Mod 2GB
Hi. Each condition that is being ORd has to be set out in full. You cannot shortcircuit this by leaving the condition to the end. The Access in-line IIF statement nearest to what you ask would be:

Expand|Select|Wrap|Line Numbers
  1. IIF(([a] > 1) OR ([b] > 1), "Yes", "No")
The OR in this case is an operator, like any other operator such as + or -. It is applied in the normal way: [expression] OR [expression].

The OR in Excel is a function, not an operator. It is applied like this:

OR ([expression], [expression])

The Excel equivalent of the in-line if (or iif for short) statement above still requires that the conditions are set out in full:

Expand|Select|Wrap|Line Numbers
  1. =IF(OR(A1 > 1, B1 > 1), "Yes", "No")
but this cannot be used in Access; use the IIF version listed above instead.

-Stewart
Mar 6 '09 #2
apank
31
Excellent.

Thank you very much.
Mar 6 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
1
by: Christian Soltenborn | last post by:
Hi experts, I am working on a university project based on VB .NET. I have a connection to MS Access, and I want to insert some data into the database. The sql command INSERT INTO Shoe (Brand,...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
14
by: Ryan | last post by:
I want to do the following SQL statement in Access. However, it won't allow me to have the secondary part of my join statement and tells me that this is not supported. OK, so Access doesn't support...
8
by: | last post by:
hi, i have a table( tblUpdate) with the following fields UpdateID, UpdateDate, ActionID UpdateID is the primary key ActionID is a foreign key i want to find the latest (by date) update...
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
7
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
6
by: InnoCreate | last post by:
Hi everyone. I've recently written a classic asp website which uses an MS Access datasource. I know this is less than an ideal data source as it has limited functionality. I have a search form on...
0
ADezii
by: ADezii | last post by:
One frequently asked question at TheScripts is "Should I use a Stored Query or an SQL Statement in those situations that require a Query (RecordSets, RecordSources, Append, Delete, Update Operations,...
1
by: rparcha | last post by:
How to convert following MS access quey to SQL server statement ACCESS: Testx: IIf(Mid(dbo_ITMaster!City,1,2)="AB",IIf(Mid(dbo_ITMaster!Plan,1,3)<>"XYZ","M",IIf(dbo_ITMaster!Center="1111", "A",...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.