Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using IIF function - need some help please

Status
Not open for further replies.

RBPM

IS-IT--Management
Jan 14, 2005
59
US
Here is my problem using IIF -

Have a table that has the following columns:

A) Date to review TD
B) Date to review CW

The values in these columns are text values for dates i.e. 5/1 , 5/2, etc.

I am trying to create a new column C based on the values found in A & B

For example:

Row Column A Column B Column C
1 5/1 blank TD
2 blank 5/1 CW
3 5/1 5/1 TD & CW

I can get the proper results for rows 1 & 2 using the IIF function but haven't been able to get the proper result for row 3. Can anyone help?
 
Code:
IIF ([Column A] IS NULL, "TD",
IIF ([Column B] IS NULL, "CW",
     "TD & CW" ))
But you may still need to deal with the circumstance where both [Column A] and [Column B] are NULL.
 
IIf(IsNull([A]), "CW", IIf(IsNull(, "TD", "TD & CW"))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for your replies. Much appreciated got what I wanted via the following:

Week of 5/1: IIf([A]="5/1",IIf(="5/1","TD & CW Revw","TD Revw"),IIf(="5/1","CW Revw",Null))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top