I need to create a column for the following:
If ([CLCLA_Eff_To_Dt] is not null or [CLCLA_Eff_To_Dt] < NOW()
then [AFFL] = "EXP" and [Assocname] = "" and [Assocnum] = "")
I am so bad at syntax.
Correct Syntax for calculated column
-
- 5StarLounger
- Posts: 627
- Joined: 03 Feb 2010, 15:02
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Correct Syntax for calculated column
That would be three calculated columns, I think.
What should be the result if the conditions are NOT met?
What should be the result if the conditions are NOT met?
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 627
- Joined: 03 Feb 2010, 15:02
Re: Correct Syntax for calculated column
I am sorry, you are right. I would have to have 3 calculations - one for Affl, one for Assoc number and one for Assoc name.
So AFFLNew: IIf([CLCLA_EFF_TO_DT] is not null or [CLCLA_EFF_To_Dt] is < now(), "EXP",[AFFL])
I am not sure about the "is not null"
So AFFLNew: IIf([CLCLA_EFF_TO_DT] is not null or [CLCLA_EFF_To_Dt] is < now(), "EXP",[AFFL])
I am not sure about the "is not null"
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Correct Syntax for calculated column
The first one would be
AFFLNew: IIf([CLCLA_EFF_TO_DT] Is Not Null Or [CLCLA_EFF_To_Dt] < Now(), "EXP", [AFFL])
If the other two follow the same pattern:
AssocNameNew: IIf([CLCLA_EFF_TO_DT] Is Not Null Or [CLCLA_EFF_To_Dt] < Now(), Null, [AssocName])
AssocNumNew: IIf([CLCLA_EFF_TO_DT] Is Not Null Or [CLCLA_EFF_To_Dt] < Now(), Null, [AssocNum])
AFFLNew: IIf([CLCLA_EFF_TO_DT] Is Not Null Or [CLCLA_EFF_To_Dt] < Now(), "EXP", [AFFL])
If the other two follow the same pattern:
AssocNameNew: IIf([CLCLA_EFF_TO_DT] Is Not Null Or [CLCLA_EFF_To_Dt] < Now(), Null, [AssocName])
AssocNumNew: IIf([CLCLA_EFF_TO_DT] Is Not Null Or [CLCLA_EFF_To_Dt] < Now(), Null, [AssocNum])
Best wishes,
Hans
Hans