473,395 Members | 1,496 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,395 software developers and data experts.

Adding Time

Hello:

I´m not a professional programer in Access. I´m working in a proyect
that will permit me add my flight time, but I have been having
problems with the time adding.

Please can some one gve me a clue to how i can add time that exceeds
24 hours (Eg. 500:47)

Thans a lot

Nicolas Mejia
Nov 13 '05 #1
5 4717
Hi Nicolas

Don't use a Date data type for your field. This is for recording a specific
date/time, not an elapsed time. I suggest using a decimal data type and
entering your elapsed time as a fractional number (eg 1.5 hours) or as an
integer (eg 90 minutes). Get your users to enter it as 1.5 or 90 etc. If
necessary you may have to have it entered in two fields, hours and minutes
(e.g 1 hour and 30 minutes).

For reports, have a function for formatting it correctly. For example,
displaying 90 minutes as '1:30'.

Jeff Pritchard
________________
Asken Research Pty. Ltd.
Access Database Developers
www.asken.com.au

"Nicolas Mejia" <nm*****@hotmail.com> wrote in message
news:8c**************************@posting.google.c om...
Hello:

I´m not a professional programer in Access. I´m working in a proyect
that will permit me add my flight time, but I have been having
problems with the time adding.

Please can some one gve me a clue to how i can add time that exceeds
24 hours (Eg. 500:47)

Thans a lot

Nicolas Mejia

Nov 13 '05 #2
Hi all,
Like Nicolas, I am not a programmer but reading through the posts here
everyday, it seems that people can do pretty much anything they want with
the correct know-how and desire. It's been a long time since I was at school
so forgive me if I am not accurate but normal numbers are in base 10 (or
100) and time is in base 60? Is there not a way that the user can tell
Access to calculate a decimal data type in base 60?

Just a thought,

Mark

"Jeff" <je************@asken.com.au> wrote in message
news:Lq***************@news.optus.net.au...
Hi Nicolas

Don't use a Date data type for your field. This is for recording a specific date/time, not an elapsed time. I suggest using a decimal data type and
entering your elapsed time as a fractional number (eg 1.5 hours) or as an
integer (eg 90 minutes). Get your users to enter it as 1.5 or 90 etc. If
necessary you may have to have it entered in two fields, hours and minutes
(e.g 1 hour and 30 minutes).

For reports, have a function for formatting it correctly. For example,
displaying 90 minutes as '1:30'.

Jeff Pritchard
________________
Asken Research Pty. Ltd.
Access Database Developers
www.asken.com.au

"Nicolas Mejia" <nm*****@hotmail.com> wrote in message
news:8c**************************@posting.google.c om...
Hello:

I´m not a professional programer in Access. I´m working in a proyect
that will permit me add my flight time, but I have been having
problems with the time adding.

Please can some one gve me a clue to how i can add time that exceeds
24 hours (Eg. 500:47)

Thans a lot

Nicolas Mejia


Nov 13 '05 #3
As Jeff says don't use the Date function, try using the "\" and
"Mod" operators.

For example I have a form which shows music CD tracks; for each
track its length is entered as minutes and seconds in separate
fields. The query it is based on has a calculated field:

TrackLength: [tracklengthmin]*60+[tracklengthsec]

Total length is given in two controls on the form:

Minutes control source =Sum([tracklength])\60

Seconds control source =Sum([tracklength]) Mod 60

This isn't the same problem as yours but it could be modified to
give hours and minutes.

nm*****@hotmail.com (Nicolas Mejia) wrote:
Hello:

I´m not a professional programer in Access. I´m working in a proyect
that will permit me add my flight time, but I have been having
problems with the time adding.

Please can some one gve me a clue to how i can add time that exceeds
24 hours (Eg. 500:47)

Thans a lot

Nicolas Mejia


--
»«»«»« Graham »«»«»«
Nov 13 '05 #4
No. Not unless I have missed something here for a long time. But the code is
simple. This function below is air code but should work okay. You may want
to add error trapping.

Function FormatElapsedTime(plngTotalMins as long) as String

Dim lngHrs as Long, lngMns as Long, strTime as String

lngHrs = Int(plngTotalMins / 60)
lngMns = plngTotalMins Mod 60
strTime = Format(lngHrs, "00") & ":" & Format(lngMns, "00")

FormatElapsedTime = strTime

End Function

Jeff Pritchard
________________
Asken Research Pty. Ltd.
Access Database Developers
www.asken.com.au

"Mark Reed" <ma*********@ntlworld.com> wrote in message
news:2USzc.20$A74.9@newsfe1-win...
Hi all,
Like Nicolas, I am not a programmer but reading through the posts here
everyday, it seems that people can do pretty much anything they want with
the correct know-how and desire. It's been a long time since I was at school so forgive me if I am not accurate but normal numbers are in base 10 (or
100) and time is in base 60? Is there not a way that the user can tell
Access to calculate a decimal data type in base 60?

Just a thought,

Mark

"Jeff" <je************@asken.com.au> wrote in message
news:Lq***************@news.optus.net.au...
Hi Nicolas

Don't use a Date data type for your field. This is for recording a

specific
date/time, not an elapsed time. I suggest using a decimal data type and
entering your elapsed time as a fractional number (eg 1.5 hours) or as an integer (eg 90 minutes). Get your users to enter it as 1.5 or 90 etc. If
necessary you may have to have it entered in two fields, hours and minutes (e.g 1 hour and 30 minutes).

For reports, have a function for formatting it correctly. For example,
displaying 90 minutes as '1:30'.

Jeff Pritchard
________________
Asken Research Pty. Ltd.
Access Database Developers
www.asken.com.au

"Nicolas Mejia" <nm*****@hotmail.com> wrote in message
news:8c**************************@posting.google.c om...
Hello:

I´m not a professional programer in Access. I´m working in a proyect
that will permit me add my flight time, but I have been having
problems with the time adding.

Please can some one gve me a clue to how i can add time that exceeds
24 hours (Eg. 500:47)

Thans a lot

Nicolas Mejia



Nov 13 '05 #5
"Nicolas Mejia" <nm*****@hotmail.com> wrote in message
news:8c**************************@posting.google.c om...
Hello:

I´m not a professional programer in Access. I´m working in a proyect
that will permit me add my flight time, but I have been having
problems with the time adding.

Please can some one gve me a clue to how i can add time that exceeds
24 hours (Eg. 500:47)

You didn't give us any information about your table structure, but if you
are looking to calculate the number of hours or minutes between two
date/time values you need to use the DateDiff() function. :

Nov 13 '05 #6

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

Similar topics

6
by: Jamie Fryatt | last post by:
Hi everyone, here's what id like to do. I have a table with 2 fields, name and value I need to be able to add multiple records quickly, for example I need to add name value abc 1...
34
by: Adam Hartshorne | last post by:
Hi All, I have the following problem, and I would be extremely grateful if somebody would be kind enough to suggest an efficient solution to it. I create an instance of a Class A, and...
5
by: Paul | last post by:
Hi I have a table that currently has 466 columns and about 700,000 records. Adding a new DEFAULT column to this table takes a long time. It it a lot faster to recreate the table with the new...
5
by: Tim | last post by:
I have block of code adding values to dropdown list under if (!Page.IsPostBack) { adding items } else { refreshing data }
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
14
by: Paul_Madden via DotNetMonster.com | last post by:
Basically I have a listbox to which I add simple STRING items- I have a progress bar which I increment whenever I populate another portion of the complete set of items I wish to add. What I observe...
4
by: Dinsdale | last post by:
I'm looking at adding scheduling features to an application and I wanted to ask the community about any experience with scheduling components, either open source like from code project or from a...
9
by: Kadett | last post by:
Hi all, I have following problem: I'm creating a ListView (Details) control at run-time and filling it with some records (let's say 10 000). This operation seems to be quite fast, but when I call...
5
by: Joe | last post by:
I'm trying to add the current time + a randomly generated time w/ millisecond precision, but the numbers aren't making sense. If I add rand_time + now_time on my calculator, I get a different...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.