Date evaluation with Null value using IIF Function (1 Viewer)

TIO OLAN

New member
Local time
Today, 09:20
Joined
Aug 22, 2022
Messages
3
Hello!

Im just want to ask help on my queries with having 5 types of Dates and some of them is having a null value. What would be the best formula or calculation to add the following initial expression including dates with null values:
IIf([DATE]>Employee Hire+60,"Production","Nesting"),
IIf([Date]>=[DatesProduction Start],"Production",
IIf([Date]>=DatesNesting Start],"Nesting",
IIf([Date]>=DatesTraining Start],"Training","Unknown")))))

I have these initial formula but it is not include the date with null values or blank. The following details are the sample dataset with null values and still looking for answers. Asking for help to solve these by using Iif function:?

Data DateHire dateTraining DateNesting DateProduction DateShould be Employee status
8/12/20227/18/20220 or Null8/8/20220 or NullNesting
8/1/202211/8/20210 or Null11/22/202112/4/2021Production
8/5/20227/18/20220 or Null8/15/20220 or NullNesting


Thank you very much
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:20
Joined
Oct 29, 2018
Messages
21,474
Hi. Welcome to AWF!

Are you trying to compare those date fields to the current date?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:20
Joined
May 7, 2009
Messages
19,245
correct me if wrong, but from what you showed, Employee Status is based on which Date is not Null?

Switch(IsNull([Production Date]) = False, "Production", IsNull([Nesting Date]) = False, "Nesting", IsNull([Training Date]) = False, "Training", True, "Unknown")
 

TIO OLAN

New member
Local time
Today, 09:20
Joined
Aug 22, 2022
Messages
3
correct me if wrong, but from what you showed, Employee Status is based on which Date is not Null?

Switch(IsNull([Production Date]) = False, "Production", IsNull([Nesting Date]) = False, "Nesting", IsNull([Training Date]) = False, "Training", True, "Unknown")
The remarks stated under Employee Status should be my final result in database and I did not get that status because of having null values in some dates like showing in the sample table. Just I dont find best formula to show that Employee status in my database sir.

Thank you very much for the help
 

Users who are viewing this thread

Top Bottom