Reputation: 195
I have three fields. Two field with two dates. Another field for total remaining days using "Computed for display". Both dates use to calculate the difference between both two and get the remaining date. For the START date I'm using @Now to get everyday current date when open the document. For my END date, is editable field set by User. As seen below figure, the start date is exceed end date.
What I want is when start date is same with end date, it stop update and remaining day becom "0". I don't know whether this is possible or not. If it possible, how can I do that? Thanks!
Upvotes: 1
Views: 277
Reputation: 30960
Use @Date to eliminate the time part of date time value.
This way
@Date(StartDate) - @Date(EndDate)
will be 0 if start and end date have the same date.
In case that fields can be empty or strings use a formula like this:
@If(StartDate = "" | EndDate = ""; ""; @Date(@ToTime(StartDate)) - @Date(@ToTime(EndDate)))
Upvotes: 1