You don't store calculations in tables. If you already have the start and
stop time in your table, then storing the duration would be redundant. What
happens if someone goes back and changes one of the "start times"? Your
stored duration would then be wrong.
In Access, you store the components of a calculated value (start time, stop
time, interest rate, exchange rate, value, etc.) then you perform your
calculations in your forms, reports, and queries.
You mention Excel. Excel is a spreadsheet. A relational database is NOT
just a fancy spreadsheet. Your tables are buckets where data is stored.
You should not be working in the tables. You can create a form or query (or
report for that matter) that will have a similar look to your spreadsheet
and you can include the calculations there.
Hope that helps.
--
Rick B
Emelina Bumsquash said:
i've just seen this post and it was helpful for me so thanks! however, do
you
know of any way you can use this time difference calculation to be
inputted
into a table field? I want to be able to record the duration but for
accuracy, i would like this to be automatically calculated from the start
and
end times. i tried the following:
RatingDuration = DateDiff("n",[StartTime],[StopTime])
but it didn't like me entering the field value before the calculation. i
was
hoping it would work something like Excel whereby a cell value can be
calculated based on the inputs of other values but it seems that in Access
i
can't then link this calculation up to an existing table field.
Can you help? any advice is greatly appreciated! all the best, emma
Rick B said:
=(DateDiff("n",[StartTime],[StopTime]))\60 &
Format((DateDiff("n",[StartTime],[StopTime])) Mod 60,"\:00")
This will show it as...
HH:MM
You can do it as just minutes if you'd prefer...
=DateDiff("n",[StartTime],[StopTime])
--
Rick B
I have made a table having a field- clockIntime and another field
ClockOutTime --I need to know the difference between the clock in and
clock
out time in my query or report.
Please reply ASAP