Hello,
I have Four fields:
[Starting Date]
[Ending Date]
[Time Extension]
[Maintenance Period]
All are on a date format.
I want to input a text on a text box field doing the following:
1) If today’s date < [Starting Date], then return “STARTING”
2) If [Starting Date] < today’s date < [Ending Date] then return “ONGOING”
3) If [Starting Date] < today’s date < [Time Extension] then return “ONGOING”
4) If [Time Extension] is Null then if [Ending Date] < today’s date < [Maintenance Period] then return “MAINTENANCE”
5) If [Time Extension] is not Null then if [Ending Date] < today’s date < [Maintenance Period] then return “MAINTENANCE”
6) If today’s date > [Maintenance Period], then return “COMPLETION”
Later, I will want the message “COMPLETED” to appear, when the user will have ticked a checkbox confirming the completion.
Going step by step with the Expression builder, I have built so far this:
It works fine with 1), 2), 3), 5), but to my surprise it did not work with 4).
Regarding 6), I did not go across it yet as I did not resolve the problem for 4).
If anyone can help…
Thanking you in advance,
G.
I have Four fields:
[Starting Date]
[Ending Date]
[Time Extension]
[Maintenance Period]
All are on a date format.
I want to input a text on a text box field doing the following:
1) If today’s date < [Starting Date], then return “STARTING”
2) If [Starting Date] < today’s date < [Ending Date] then return “ONGOING”
3) If [Starting Date] < today’s date < [Time Extension] then return “ONGOING”
4) If [Time Extension] is Null then if [Ending Date] < today’s date < [Maintenance Period] then return “MAINTENANCE”
5) If [Time Extension] is not Null then if [Ending Date] < today’s date < [Maintenance Period] then return “MAINTENANCE”
6) If today’s date > [Maintenance Period], then return “COMPLETION”
Later, I will want the message “COMPLETED” to appear, when the user will have ticked a checkbox confirming the completion.
Going step by step with the Expression builder, I have built so far this:
Code:
=IIf(Date()<[Start Date],"Starting",IIf(Date()>[Start Date] And Date()<[Ending Date],"Ongoing",IIf(Date()>[Start Date] And Date()<[Time Extention],"Ongoing",IIf([Time Extention]=Null,IIf(Date()<[Maintenance Period] And Date()>[Ending Date],"Maintenance"),IIf(Date()<[Maintenance Period] And Date()>[Time Extention],"Maintenance")))))
Regarding 6), I did not go across it yet as I did not resolve the problem for 4).
If anyone can help…
Thanking you in advance,
G.
Comment