How do I modify the following formula to enter 0 or blank if the DateTimeDiff([First Login],[Start Date],"days") = negative number of days?
Formula:
DateTimeDiff([First Login],[Start Date],"days")
Hi @Lkschwe
You could use an if statement:
IIF(DateTimeDiff([First Login],[Start Date],"days")<0,0,DateTimeDiff([First Login],[Start Date],"days"))
Green: Condition, is the difference < 0
Red: Value if the condition is true (0)
Orange: values for if condition is false, the difference between the days
You can use,
max(DateTimeDiff([First Login],[Start Date],"days"), 0)
Another method is a standard conditional statement:
if DateTimeDiff([First Login],[Start Date],"days")<0
then 0
else DateTimeDiff([First Login],[Start Date],"days")
endif
@Lkschwe
Looks like I am late for the party.
I made sample with all the nice formula provided and just a note that if you want "Blank", the output has to be string.
Null can be for numeric value though.