Calculate elapsed days

J

Jason

I currently have the fields Date Recieved, Date to Customer and Cycle Time.
The Date Recieved is set to default Now(). What I want to do is have the
Cycle Time field display the word "Open" until an entry is made in the Date
to Customer field at which time it should calculate the days elapsed. I
initially tried to just set the default value of the Cycle Time field in the
Table Design view to

=DaysElapsed:DateDiff("d",[Take-Off Drawings]!Date to Customer], [Take-Off
Drawings]![Date Recieved])

But it kept telling me it did not recognize the Date to Customer field.
Variations on the expression were also unsuccessful. I currently have the
default value of the Cycle Time field in the form set to the above expression
and it seems to be working, but I would like to lock this field so that no
entry needs to be made and all past records will be updated the same. I
found the above expression in other discussions, but beyond this I'm pretty
lost.
 
A

Allen Browne

Jason, remove the [Cycle Time] field from your table.

Instead, create a query, and type your expression into the Field row in
query design:
DateDiff("d", [Date to Customer], [Date Received])
Then use this query where ever you would have used your table.

That's always the way you do calculated fields. See:
Calculated fields
at:
http://allenbrowne.com/casu-14.html
 

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

Top