Calculating Dates

S

Sally

In my database I'm creating, I have a few date fields.
They are:
Date Discovered
Date Received
Date Signed

I need 2 more fields:
Days Elapsed Received
Days Elapsed Discovered

This used to be on Excel and the formula to
calculate "Days Elapsed Received" is =DAYS360
(DateReceived,DateSigned)

The formula for "Days Elapsed Discovered" is =DAYS360
(DateDiscovered,DateSigned)

When I'm setting up the table, I want all five fields to
be saved in the table. Where do I put the formula to
calculate Days Elapsed Received & Days Elapsed Discovered?
Do I place it in the table? I am going to create a form
to use as well and a report based on this information.

Thanks - Hope this is not too confusing
 
T

tina

generally speaking, you shouldn't save a calculation as
hard data in a table. as long as you have the raw data -
in this case the 3 dates - you can calculate elapsed days
whenever you need to.
see the DateDiff() function in Help. using it, you can
calculate elapsed days to display in a query, form or
report as needed.
if you're determined to save the value as additional table
data, you can also use the DateDiff() function in a form
macro or module during manual data entry to set the value
of the elapsed fields, or in an append query when
importing data, or in an update query.
 
S

Sally

Thank you for your help - I see what you mean about
putting the calculations directly into the table. So, if
I am going to create a form with this info, what is the
bast way to handle this? Should I create a query based on
the table info and then create a form based on the table?
Or is there a better way to do this?

Thank you again
 
J

John Vinson

So, if
I am going to create a form with this info, what is the
bast way to handle this? Should I create a query based on
the table info and then create a form based on the table?

Create a query and base the form ON THE QUERY. It is not necessary (in
fact it's not even very common in professional databases) to base a
Form directly on a Table; Queries work perfectly well.
 

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