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/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
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... ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top