Display the lesser of two DateDiff expressions

  • Thread starter Thread starter RussCRM
  • Start date Start date
R

RussCRM

I have two fields - ProgramEntry and ProgramExit.

I want to calculate how long a person has been in a program. I can do
that with a DateDiff ("d",[ProgramEntry], Date()) expression. But, I
run into a problem when they exit the program as it will keep adding
dates. Basically, I'm thinking that maybe I can have it calculate the
two DateDiff expressions and then display the lesser of the two (which
I don't know how to do) unless someone has another suggestion.

Any ideas?
 
I have two fields - ProgramEntry and ProgramExit.

I want to calculate how long a person has been in a program. I can do
that with a DateDiff ("d",[ProgramEntry], Date()) expression. But, I
run into a problem when they exit the program as it will keep adding
dates. Basically, I'm thinking that maybe I can have it calculate the
two DateDiff expressions and then display the lesser of the two (which
I don't know how to do) unless someone has another suggestion.

Any ideas?

You only need one datediff if I understand this correctly:

DateDiff("d", [ProgramEntry], NZ([ProgramExit], Date())

will return the number of days from programentry to programexit *IF* there is
a date in programexit; if there isn't, the NZ function will use today's date
instead.
 
Back
Top