Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / September 2009

Tip: Looking for answers? Try searching our database.

IIf funtion based on multiple criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jennifer - 30 Sep 2009 20:23 GMT
I have the following expression but want the criteria to include 2 fields:

IIf(IsNull([HR]),2,1)

If HR is null AND NARC is null I want a 2 otherwise a 1.  

Thank you for your help.
Duane Hookom - 30 Sep 2009 21:03 GMT
Try
IIf(IsNull([HR]) AND IsNull([NARC]),2,1)

Signature

Duane Hookom
Microsoft Access MVP

> I have the following expression but want the criteria to include 2 fields:
>
[quoted text clipped - 3 lines]
>
> Thank you for your help.
Marshall Barton - 30 Sep 2009 21:03 GMT
>I have the following expression but want the criteria to include 2 fields:
>
>IIf(IsNull([HR]),2,1)
>
>If HR is null AND NARC is null I want a 2 otherwise a 1.  

IIf(IsNull([HR]) And  IsNull(NARC),2,1)

will do what you asked, but without any context I have no
way of knowing if that's the best way to do it or even if
that is what you need to do.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.