Display the lesser of two DateDiff expressions

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?
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Display weeks from a Milestone 0
CalcWorkDays error 2
Can't query DateDiff 0
No results using DateDiff 5
NZ in null date 1
Calculate No. Days between two dates 5
DateDiff() 6
RecordsetNot Updateable 22

Top