start time / end time calculation

  • Thread starter Thread starter Gary Nelson
  • Start date Start date
G

Gary Nelson

In Access2000 (Frontend) SQL (backend) I have a view / report that I am
creating which will have a start time / end time with start date / end date
inclusive. I am being asked to calculate the start time / end time to
provide the total time it took to do a task. Can you please offer some
assitance with the correct way to calculate these fields?

Thanks in advance.
 
In Access2000 (Frontend) SQL (backend) I have a view / report that I am
creating which will have a start time / end time with start date / end date
inclusive. I am being asked to calculate the start time / end time to
provide the total time it took to do a task. Can you please offer some
assitance with the correct way to calculate these fields?

Take a look at DateDiff: to calculate the number of miNutes between
date/time fields StartTime and EndTime you can use

DateDiff("n", [StartTime], [EndTime])

("m" would get months, which might be appropriate in some contexts...)
 
John,

Once I have the start / end times calculated, what is the best way to
provide an overall sum? This will be used to be part of a report. The user
has asked for an individual amount of time used as well as a final total at
the end of the report.

Thanks in advance,
Gary

John Vinson said:
In Access2000 (Frontend) SQL (backend) I have a view / report that I am
creating which will have a start time / end time with start date / end date
inclusive. I am being asked to calculate the start time / end time to
provide the total time it took to do a task. Can you please offer some
assitance with the correct way to calculate these fields?

Take a look at DateDiff: to calculate the number of miNutes between
date/time fields StartTime and EndTime you can use

DateDiff("n", [StartTime], [EndTime])

("m" would get months, which might be appropriate in some contexts...)
 
John,

Once I have the start / end times calculated, what is the best way to
provide an overall sum? This will be used to be part of a report. The user
has asked for an individual amount of time used as well as a final total at
the end of the report.

I'd suggest calculating each time difference as well (I have NO clue
how or from what you're calculating the start/end times so I can't say
just how one would do that), and display the individual times; in a
report Footer you can put

=Sum([timevalue])

to sum the query field, and/or use a formatting expression as
suggested on the Sum().
 
I too am having problems with time calculations. I have about 130
records, all with a TimeOrdered, and TimeOrderComplete field. I trie
the DateDiff within an Append query to post the answer to
OrderDuration field. The time fields are defined as "Short Time" s
they appear as "03:25" for 3:25AM and "17:40" for 5:40PM.

Here is where the problem starts. 70% of the records are poste
correctly, but another 30% have the answers posted "backwards," in tha
a duration of 30 minutes is posted as "23:30". I have manually checke
the table and the times are correct, all my Complete times are late
than the Order time.

Specific Update To: follows:

DateDiff("nn",[TimeOrdered],[TimeOrderComplete])

Is this a Bill Gates undocumented feature or a true bug?

MS Access 2002 w/SP-2, 2GB Dell w/512MG RA
 
I too am having problems with time calculations. I have about 130
records, all with a TimeOrdered, and TimeOrderComplete field. I trie
the DateDiff within an Append query to post the answer to
OrderDuration field. The time fields are defined as "Short Time" s
they appear as "03:25" for 3:25AM and "17:40" for 5:40PM.

Here is where the problem starts. 70% of the records are poste
correctly, but another 30% have the answers posted "backwards," in tha
a duration of 30 minutes is posted as "23:30". I have manually checke
the table and the times are correct, all my Complete times are late
than the Order time.

Specific Update To: follows:

DateDiff("nn",[TimeOrdered],[TimeOrderComplete])

Is this a Bill Gates undocumented feature or a true bug?

MS Access 2002 w/SP-2, 2GB Dell w/512MG RA
 
Back
Top