473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help needed adding times problem


Hi Folks,

We have a form that records flight times in hours and minutes, for example a
1 hour 15 minute flight is recorded as 1:15 Does anyone know how to get
Access 2003 to calculate a total figure for a number of flight times
recorded in a datasheet form? and is there a way to display flight times
greater than 24 hours i.e 26:20 for example? The only solution i can find is
to use decimal times i.e 1.25 instead of 1:15 which is our least preferred
solution.

Many thanks

Nige

Mar 19 '07 #1
1 2932
If you use a Date/Time field to store a duration, the math may not work as
you expect. Explanation below.

You could show the total time in minutes with a text box in the Form Footer
(or Report Footer) bound to this expression:
=DateDiff("n", Sum([FlightTime]), #0:00:00#)

For details on converting that to minutes see:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html

Or, if you do not need to perform any further math on the total, you could
use this custom DateDiff replacement:
http://www.accessmvp.com/djsteele/Diff2Dates.html

As to why it works like that, Access stores date time values as the number
of days since Dec 30, 1899. Consequently, if it wraps past 24 hours, it will
show the result as Dec 31, 1899 plus the time. And if you have suppressed
the date (e.g. by formatting as short time), all you see is the remainder.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Nigel Heald" <ni***@mrauk.co.ukwrote in message
news:12*************@corp.supernews.com...
>
We have a form that records flight times in hours and minutes, for example
a
1 hour 15 minute flight is recorded as 1:15 Does anyone know how to get
Access 2003 to calculate a total figure for a number of flight times
recorded in a datasheet form? and is there a way to display flight times
greater than 24 hours i.e 26:20 for example? The only solution i can find
is
to use decimal times i.e 1.25 instead of 1:15 which is our least preferred
solution.
Mar 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
4
by: Derek | last post by:
Hi, I've built a rather large CGI that dumps a lot of data and a fairly complex javascript app out to the client's browser. Granted this may be poor style according to someone web design...
28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
31
by: mark | last post by:
Hello- i am trying to make the function addbitwise more efficient. the code below takes an array of binary numbers (of size 5) and performs bitwise addition. it looks ugly and it is not elegant...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
2
by: Anan18 | last post by:
Use Integer variables to represent the private data of the class – the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it is...
118
by: Chuck Cheeze | last post by:
This might be in the wrong group, but... Here is an example of my data: entry_id cat_id 1 20 2 25 3 30 4 25 5 35
6
by: Simon Harvey | last post by:
Hi all, I'm really hoping someone can help me with this as it's causing me some serious problems. I have a Windows Forms application using the gridview control. When the user selects a row,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.