473,405 Members | 2,154 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,405 software developers and data experts.

how to break the bounds of 59 in date/time data type

x
hi
i am a pilot by profession. i want to create a database of my logbook
using ms access 2002. i am facing a problem regarding the format of
time field. when i select "Data/Time" data type for my time field then
this format gives the liberty to record times uptill a figure of 59 in
different sub-formats, whereas i want the format to be able to record
the times like 80:35 or 1:10 or 1138:00. which means that i have these
many hours on a specific aircraft. i also want to carryout sum
operation on these timings. i have found out that i can use "[hh]:mm"
format in ms excel 2002 to suite my requirements but it doesn't work in
access.
i am a very basic user of access or for that matter any database.
please consider this while replying my question. i have no background
of vb code which means that i will only be able to work the things out
which are not very advanced (point and shoot mouse user).
Thanx in advance and please be eleborate in your reply.
bye and tc

Feb 16 '06 #1
2 2452
x wrote:
time field. when i select "Data/Time" data type for my time field then
this format gives the liberty to record times uptill a figure of 59 in
different sub-formats, whereas i want the format to be able to record
the times like 80:35 or 1:10 or 1138:00. which means that i have these
many hours on a specific aircraft. i also want to carryout sum
operation on these timings. i have found out that i can use "[hh]:mm"
format in ms excel 2002 to suite my requirements but it doesn't work in
access.
i am a very basic user of access or for that matter any database.


Hi,

When one designs a database, it's necessary to determine what data
entities you want to track and how each entity is to be represented.
This is what you are doing here, but I think you've chosen the wrong
data type for your time field. A date/time field is meant to record a
calendar date and clock time. However, what you need to record is not a
date or a time (though, of course, doubtless you'll wish to record the
date a flying entry takes place) but rather a QUANTITY where the
quantity is a measure of time. Ultimately, what you want to do is
determine the total number of hours/minutes you've flown (ie, a complete
total, or by aircraft type, by date range, or what have you).

The difficulty you (and many of us, including me, incidentally) have is
that it's a bit of a mind twist to get around "x hours and y minutes".
But what you have to do is ultimately figure out what is the actual unit
of measure for your flying time is. I would suggest it's MINUTES.

So, what you need is a field called "Flight_Minutes" or something with a
numeric data type. Now, there are various number formats, and I would
choose a Long Integer (some might choose a short integer, but what the
heck...). What you want to record in your field is number of minutes.
Thus, the examples you chose, what would go into the field would be (i'm
assuming your format is hours:minutes):

80:35 would be 80 hours times 60 minutes plus 35 minutes: 4835 recorded
in the "Flight_Minutes" field, and so on.

Now... 80:35 is easily understandable but your colleagues will look at
you like you're cracked if you tell em "ya I have 4,835 minutes in dat
model". 8) But this is an issue with DISPLAY of your information and
DATA ENTRY of your information.

Display and data entry are handled by using forms. Read up in the help
on how to do this and ask here when you hit stumbling blocks.

To display your minutes in an acceptable format, we use functions and
expressions which Access provides. To DISPLAY your information, I would
have a form that is set up around a query (the correct term is "bound to
a query") that pulls out the information you want to display (type of
model, time period, etc, etc). You will set up a text box on the form
that has a formula in it that references the Flight_Minutes field of the
query and calculates what the display should be:

=int([Flight_Minutes]/60) & ":" & [Flight_Minutes] mod 60

The int function divides flight minutes by 60 and returns the result
without any fraction, ie, 4835 divided by 60 = 80.58333, but the int
function will return just an 80. The mod operator does the division but
only returns the remainder. The remainder of 4835 is 35, thus the
expression would return 80:35.

To data enter your times, it is slightly more complicated. It is always
proper practice in any database to use forms for data entry rather than
directly enter your time into the database, but wih a little bit of code
(don't be scared!) you'll be able to type 80 and 35 into a form and
Access will convert it to minutes for you.

However, perhaps it's best to master the display part first and then we
can work on the data entry part.

I'm a long winded twit, and it may well be someone has answered this for
you much more breifly than I!

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Feb 16 '06 #2
x
thanx dear
it was no doubt a rewarding xperience to learn from you
bye and tc

Feb 17 '06 #3

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

Similar topics

5
by: nick_faye | last post by:
hi, how can i set the dates in a fieldn in my tables in ms access to handle only dates and no time? in creating my table, i set its type to 'date/time' with 'short date' format. but when i...
50
by: jacob navia | last post by:
As everybody knows, the C language lacks a way of specifying bounds checked arrays. This situation is intolerable for people that know that errors are easy to do, and putting today's powerful...
22
by: jacob navia | last post by:
A function like strcpy takes now, two unbounded pointers. Unbounded pointers, i.e. pointers where there is no range information, have catastrophic failure modes specially when *writing* to main...
11
by: Dixie | last post by:
How can I programatically, take some Date/Time fields present in a table in the current database and change their type to text? dixie
5
by: Ray | last post by:
I have a table with some audit date and time columns. Problem is the developer who stored the data left them as DECIMAL type instead of DATE and TIME. Is there a way I can convert the DECIMAL type...
125
by: jacob navia | last post by:
We hear very often in this discussion group that bounds checking, or safety tests are too expensive to be used in C. Several researchers of UCSD have published an interesting paper about this...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
11
by: Connie via AccessMonster.com | last post by:
Hi Access Building Friends, I am building a database for a manufacturer who needs to know the projected End_Date of each job. I know the Start_Date and the total days required to do the job. ...
13
by: chromis | last post by:
Hi, I have a query which updates the projects table of my database, however when I try to run my query with blank values i get the following error: Data truncation: Data truncated for column...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.