Re: adding Time / time Formats



Ramon wrote:
I have a query that currently calculates time in the 00:15:36 format.
Is there a way that can change that format to read 15min 36Sec
instead of 00:15:36?

Please assist

Use a format property of...

"nn\M\i\n ss\S\e\c"

or the Format() function...

=Format(FieldName, "nn\M\i\n ss\S\e\c")

BUT... note that in an Access database 00:15:36 does NOT mean 15 minutes and 36
seconds. It means 15 Minutes and 36 seconds past midnight on December 30, 1899.

Database DateTimes store "points in time" not "amounts of time". Because they
are stored under the covers as numbers you can treat them as durations (to a
point), but once you accumulate more than 24 hours they roll over to December
31, 1899 and the time portion goes back to zero.

If you need to store durations you are better off using a long integer field to
store the total number off seconds and then convert to hours and minutes for
display. All computations would be done on the number of seconds.



--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com




.



Relevant Pages

  • Re: date problem/grabbing data
    ... >But you say this is a bad way to store durations of time (and i do want to ... Create a Long Integer field instead. ... My suggested formula was NOT a Format. ...
    (microsoft.public.access.formscoding)
  • Re: Please help me total hours worked per week????
    ... > now if i inputed these hours in as (Time format) they would total...=14:03 ... This is further complicated by the fact that since Date/Time values are ... internally stored as double-numbers one can perform "Math" on them in certain ... store durations. ...
    (microsoft.public.access.gettingstarted)
  • Re: Summing it all up
    ... Changed the Format property to Currency. ... In the subform, check the Name of the Subtotal text box, and set its ... >> Format property to Currency so Access knows the data type. ...
    (microsoft.public.access.formscoding)
  • Re: Sum,Sort, Format, and Date Range
    ... it is best to let query's get the raw data & let the display ... Sum([COST DIECOST]) AS ... Format property, ...
    (microsoft.public.access.queries)
  • Re: Change Date Format
    ... Make sure you are settig the format PROPERTY for the control. ... "John Spencer" wrote: ...
    (microsoft.public.access.reports)