Query for time

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

Guest

I have a [StartTime] and a [EndTime] in a table how do I make a query to
calculate the duration between the 2.
 
I tried to do that on my database, and I could'nt get datediff to work. I'll
be very interested to hear if you find a way. If you don't, it's a pretty
easy step to just let data entry people handle. Once you have a number in
minutes, it's easy to manipulate.
 
the best way to use the time between two points is with a query in the
criteria area type--

between [Enter Starting Date] And [Enter Ending Date]

this will display a paramerter prompt for the dates that you are interested
in and will create a table that includes those dates.
 
What kind of error are you getting. It is working fine for me. The only
suggestion I would change is to replace the h with n to get it in minutes,
and convert to hours. Keeping h causes rounding to occur.
 
I should have been more specific. My problem lay in the fact that I didn't
want to type in date, time, and AM/PM info for both fields; I only wanted to
type in two times and find the difference in minutes. Guess I'm just too
eager to shave keystrokes.
 
You don't have to type the date just the time. You could avoid AM and PM in
you use military time 15:00 instead of 3:00 PM. Datediff will work. you may
have to use "#" to get it to recognize that it is a time format, but your
table should be storing as date/time. you can also format textboxes to be a
time format.
 

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

Back
Top