Solved IIF Statement (1 Viewer)

Mick3911

Registered User.
Local time
Today, 00:42
Joined
Jul 31, 2018
Messages
40
I am getting myself confused having spent too much time on an IIF statement

I have a query where I want to create a column named TrainingStatus and have it filled with either 'Not Trained' or 'In Progress' or 'Trained'.

I have used the following but get an error message saying that I have the wrong number of arguments.

Code:
TrainingStatus: IIf(IsNull([StartTime]),"Not Trained",IIf(Not IsNull([StartTime]) AND (IsNull([DateCompleted],"In Progress"),IIF(Not IsNull([StartTime]) AND (Not IsNull([DateCompleted]),"Trained"))

Can anyone help please?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:42
Joined
May 7, 2009
Messages
19,237
TrainingStatus: Switch(IsNull([StartTime]),"Not Trained", IsNull([DateCompleted]),"In Progress", True,"Trained")
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:42
Joined
Oct 29, 2018
Messages
21,469
You could also try:
Code:
TrainingStatus: IIf(IsNull([StartTime]),"Not Trained", IIf(IsNull([DateCompleted]),"In Progress","Trained"))
 

Mick3911

Registered User.
Local time
Today, 00:42
Joined
Jul 31, 2018
Messages
40
Thank you arnelgp and theDBguy, bot work a treat, much appreciated.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:42
Joined
Oct 29, 2018
Messages
21,469
Thank you arnelgp and theDBguy, bot work a treat, much appreciated.
Hi. You're welcome. Arnel and I were happy to assist. Good luck with your project.
 

Users who are viewing this thread

Top Bottom