Thanks for the reply dgillz. The example code I found is this;
datetimevar min := minimum({@Character field to date field in process date});
datetimevar max := maximum({@Character field to date field in process date});
numbervar yrs := datediff("yyyy",min,max);
numbervar mos;
if month(max) >= month(min) then
mos := datediff("m",min,max)-(yrs*12) else
if month(max) < month(min) then (
yrs := yrs-1;
mos := datediff("m",min,max)-(yrs*12)
);
numbervar days :=
if day(max)>= day(min) then
days := day(max) - day(min) else
if day(max) < day(min) then (
mos := mos-1;
days := day(max)+(day(max-day(max))-day(min))
);
totext(yrs,0,"")+" Yrs "+totext(mos,0,"")+" Mos "+totext(days,0,"")+ " Days"
From the advice you have given, this appears to be very reliant on there being a start and end date so it not so simple as replacing the dates with a number.
Do you have some more appropriate code for my problem?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.