Hour Format

kernel76

Registered User.
Local time
Today, 14:49
Joined
Oct 17, 2003
Messages
27
HI! I've a problem with the format "HOUR"! :confused:

I don't succeed to make the sum of values expressed in format hour why it doesn't exist or I don't know a format that gives back a advanced value to the 24 hours. :(

I know that he can be only made in excel, where it exist the type of format "37.30.55" that it allows me to add the values type "HOUR"

thank for any reply!
sorry for my english
I ask you help from Italy
 
Late4Supper said:
Have you tried the format property for Date/Time data types?


:confused:

I have tried,but I have not found format property for a Date/Time that it supports format >24H
I don't succeed to find no solution!
:(
 
Format Short Time worked for me for a 24 clock.
1:00 am = 1:00
2:00 pm = 14:00
 
Late4Supper said:
Format Short Time worked for me for a 24 clock.
1:00 am = 1:00
2:00 pm = 14:00


SURE! bat no greater of 24H

7 hours+
10 hours+
7 hours+
8 hours =
---------
32 hours!

it would be my solution

:(
 
Plan B (maybe)

When I added several records with the format set to Short Time I got

12:00 PM = 12:00 +
01:00 AM = 1:00 +
02:00 PM = 14:00 =
1.125 [days ] * 24 = 27 Hours

I've attached a ACCESS 2002 zipped file for an example.
 

Attachments

I've attached a jpg image to show you an example

:confused:

thanks a lot! :)
 

Attachments

  • example.jpg
    example.jpg
    41.2 KB · Views: 214
12.2 means 12.2 hours.

To show it in hours and minutes, you will need a more complicated expression than just multiplying by 24. See the query in the attached database.


Note
Since the sum may exceed 24 hours, the expression returns a text string, not the date/time data type.
 

Attachments

Jon K THANK YOU VERY MUCH !!! :D

I have applied the query to my DB and I'm very enjoy because it works very well
I'd like to ask you another thing if it's possible:
I would have to make of the calculation operations on that data therefore
I would be better if it were expressed in numerical format.... :eek:

THANKS A LOT TO Jon K and Late4Supper :p
 
I will try to explain this, but it is tricky because technically, time/date fields are not really designed for what you are doing. I hope my English is clear enough that your ability to translate will not be overly stressed.

If you use date/time fields to store hours, you are not storing hours. You are storing "days and fractions of a day since a reference date" because that is what is REALLY inside a date/time field. Since the Windows reference date is something like 1-Jan-1900, the day count is now well over 36524 days. (Day 36524 was 1-Jan-2000.) By this standard, Noon of 1-Jan-2000 was 36524.5, because midnight is the reference time for each day.

You need to think of hours, not as time, but as just another quantity like kilograms or kilometers, that can have an integer part and a fractional part, because in the long term, a date/time field will NEVER do what you really want it to do. The format conversion routines don't think of time in the same way you do. And I believe this important factor is where many people find trouble.

One solution might be to write a couple of string/number conversion functions that take STRING input like "hh:mm" and produce SINGLE or DOUBLE values like hh.hhhh as output... and also the reverse of course. Then add your numbers in SINGLE or DOUBLE format and convert them back later. If you do this, write your functions in a general module and remember that they must be declared Public. Then you could manipulate all the times you want and use the function in queries, forms, and reports.

Once you stop thinking of hours as TIME and instead treat it like some other kind of quantifiable, fractionally countable resource, it might help you to make a better design.
 

Users who are viewing this thread

Back
Top Bottom