Forum Discussion
KenFirch
8 years agoQrew Trainee
For a formula duration field:
var date thisyear = Date(Year(Today()),Month([Birth Date]),Day([Birth Date]));
var date nextyear = Date(Year(Today()) + 1,Month([Birth Date]),Day([Birth Date]));
If($thisyear >= Today(),
$thisyear - Today(),
$nextyear - Today())
var date thisyear = Date(Year(Today()),Month([Birth Date]),Day([Birth Date]));
var date nextyear = Date(Year(Today()) + 1,Month([Birth Date]),Day([Birth Date]));
If($thisyear >= Today(),
$thisyear - Today(),
$nextyear - Today())
KenFirch
8 years agoQrew Trainee
You would have to use a formula text field for that:
var date thisyear = Date(Year(Today()),Month([Hire Date]),Day([Hire Date]));
var date nextyear = Date(Year(Today()) + 1,Month([Hire Date]),Day([Hire Date]));
var number dayscount = If($thisyear >= Today(),
ToDays($thisyear - Today()),
ToDays($nextyear - Today()));
If($dayscount <= 90,
"<span style=\"color:red;\">" & ToText ($dayscount) & "</span>",
"<span style=\"color:black;\">" & ToText ($dayscount) & "</span>")
You lose some filtering by numeric ability using this method, but you could display the "red" records by setting a filter on this field that contains a "red" value.
var date thisyear = Date(Year(Today()),Month([Hire Date]),Day([Hire Date]));
var date nextyear = Date(Year(Today()) + 1,Month([Hire Date]),Day([Hire Date]));
var number dayscount = If($thisyear >= Today(),
ToDays($thisyear - Today()),
ToDays($nextyear - Today()));
If($dayscount <= 90,
"<span style=\"color:red;\">" & ToText ($dayscount) & "</span>",
"<span style=\"color:black;\">" & ToText ($dayscount) & "</span>")
You lose some filtering by numeric ability using this method, but you could display the "red" records by setting a filter on this field that contains a "red" value.