# Is there no "AND" function in Access like in Excel?

X

#### xyzer

I would like to write something like this

IIF(AND([Column 1]=0,[Column 2]=0,[Column 3]=0,"Y","N")

But this does not seem to work in Access.

I guess I will just have to use multiple embedded IIF statements to exclude rows where all 0s exist.

J

#### John W. Vinson

I would like to write something like this

IIF(AND([Column 1]=0,[Column 2]=0,[Column 3]=0,"Y","N")

But this does not seem to work in Access.

I guess I will just have to use multiple embedded IIF statements to exclude rows where all 0s exist.

Access is NOT a flawed implementation of Excel. Of course you can do AND/OR
logic in Access. But it's DIFFERENT.

Iif([[Column 1] = 0 AND [Column 2] = 0 AND [Column 3] = 0, "Y", "N")

Logical expressions in Excel use the builtin AND() or OR() functions. In
Access, you can write out an expression in Boolean logic. The keyword AND is
an operator in Boolean algebra, just like the key symbol + is an operator in
arithmatic:

X AND Y is TRUE if both X and Y are true, FALSE otherwise
X OR Y is TRUE if either X is true, or Y is true, or both are true, FALSE if
both are false

Either X or Y can be a fieldname, or an arbitrarily complicated expression.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/

C

#### croy

I would like to write something like this

IIF(AND([Column 1]=0,[Column 2]=0,[Column 3]=0,"Y","N")

But this does not seem to work in Access.

I guess I will just have to use multiple embedded IIF statements to exclude rows where all 0s exist.

Access is NOT a flawed implementation of Excel. Of course you can do AND/OR
logic in Access. But it's DIFFERENT.

Iif([[Column 1] = 0 AND [Column 2] = 0 AND [Column 3] = 0, "Y", "N")

Except for that double left bracket... ;-)