.25 hours is 15 minutes (0:15), so your math is right!
Date/Time fields would be better named "Datestamp" fields - they are
really intended to hold a value corresponding to such and such a time
on such and such a date. Internally, they are stored as special
floating point numbers of which the integer part represents the day
and the fractional part represents the time, as a fraction of a _day_.
If you want to display a time difference in hours, you need to divide
the result of your basic time subtraction by 24 and format it as a
regular floating point number with however many decimal places you
want to see.
Your second problem results from the "Short Time" format displaying
"negative time" without anything that distinguishes it from "positive
time". If you put in a time without specifying am or pm, it will be
assumed that you are using a 24 hour clock. 1:00 - 11:15 thus comes
out to a time value equivalent to _minus_ 10:15, which is meaningless,
and Access ignores the negative sign and displays the time value.
You can deal fairly easily with times that do not cross midnight if
you use the 24 hour clock to enter them and multiply differences byt
the appropriate number to get them in the units that you want. With
slightly more difficulty, you can deal in a similar way with times
that do cross midnight, provided that differences are guaranteed to be
less than 24 hours. Beyond that, life gets fairly fraught.
I'm trying to take two fields (timestart and timestop) and figure out the
time in hours (timeinhours).
So if timestart = 11:15 and timestop = 11:30, I want timeinhours to be ..25.
The only thing I've come up with shows timeinhours as :15. Timeinhours is a
unbound textbox, in this case formatted as 'short time' and with a
datasource of
=[timestart]-[timestop]. (Also with the above formula and control
properties, 11:15 - 1:00 is 10:15?!?!?!)
Does any one have any ideas how I can do this?
Karen
Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption