How do I set conditions to stop calculations?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that tracks dates for students who transfer. My question
involves an estimated arrival at a new location(EDA) and the actual date they
leave(Transfer Date). What I have done is subtracted the estimated arrival
date from the current date to give me a total number of days. What I need it
to do is stop the calculation once they actually leave from the current
location. How do I write the equation, or rather, what needs to be included
in the equation to make the calculation stop when they leave? My fields are
titled as follows: "Expr1"(todays date), "EDA"(expected transfer date),
"Total Days"(that have passed from EDA), "Status"(a pulldown listing
including term "Transfer"). I have tried many different equations to get
this to work, but am lost in the terminology and required equation parts.

Respectfully,

Phillip
 
Phillip,

Do you have a field in your table for the TransferDate? You mentioned
this at first, but doesn't seem to be included in the subsequent
discussion, but if I understand you correctly this value must be used in
your final calculation.
 
Steve,
Thank you for responding. Yes I do have a field for Transfer Date and
yes, I think it should have something to do with the final equation, but not
sure how it will come into play. If the Transfer Date field isn't used, then
perhaps the Status field should be used. I have thought about both, but
don't understand enough about the programming of the equations/expressions.
Right now the Expr1 is the current date and have gotten stuck with that as
the main factor in the existing equation.
 
Phillip,

If I can assume you are performing this calculation in a query, and if I
can assume that what you really want to do is this:
"If there is an entry in the Transfer Date field, show the number of
days between the Transfer Date and the Estimated Arrival Date, otherwise
(i.e. if there is no Transfer Date entered), show the number of days
between today and the Estimated Arrival Date" (if I have misinterpreted
you here, please try to clarify)...
NumberOfDays: IIf(IsNull([Transfer Date]),Date(),[Transfer
Date])-[Estimated Arrival Date]
This can be simplified to...
NumberOfDays: Nz([Transfer Date],Date())-[Estimated Arrival Date]
 
Back
Top