A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Format Table data type for time



 
 
Thread Tools Display Modes
  #1  
Old April 20th, 2009, 10:02 AM posted to microsoft.public.access.tablesdbdesign
Frank
external usenet poster
 
Posts: 551
Default Format Table data type for time

I want to use time in the following way. An athlete runs a time of 1minute 30
seconds and split seconds of 2/3 100th of a second for example: I want to use
the time as follows 01:30.66 [This must be the way one have to input the time
in a form and use it in a query. How do I format the data type to use this
time in calculations. Example fastest and slowest and also sorting the times
from fast to slow ect.
  #2  
Old April 20th, 2009, 10:45 AM posted to microsoft.public.access.tablesdbdesign
Noëlla Gabriël
external usenet poster
 
Posts: 79
Default Format Table data type for time

Hi Frank,

the access date/time data type isn't really suited to display 100th of
seconds, you'll have to use a separate field for it. You can display minutes
and seconds in a date/time filed, but in this case I think you better store
the data in 3 separate fields: 1 for the minutes, one for the seconds and 1
for the 100ths of seconds.
You can use 3 numeric fields (integers) and limit their values the seconds
field to 59 and the 100ths field to 99.
In reports you can concatenate the numbers to one expression.
--
Kind regards
Noëlla


"Frank" wrote:

I want to use time in the following way. An athlete runs a time of 1minute 30
seconds and split seconds of 2/3 100th of a second for example: I want to use
the time as follows 01:30.66 [This must be the way one have to input the time
in a form and use it in a query. How do I format the data type to use this
time in calculations. Example fastest and slowest and also sorting the times
from fast to slow ect.

  #3  
Old April 20th, 2009, 06:51 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Format Table data type for time

On Mon, 20 Apr 2009 02:02:22 -0700, Frank
wrote:

I want to use time in the following way. An athlete runs a time of 1minute 30
seconds and split seconds of 2/3 100th of a second for example: I want to use
the time as follows 01:30.66 [This must be the way one have to input the time
in a form and use it in a query. How do I format the data type to use this
time in calculations. Example fastest and slowest and also sorting the times
from fast to slow ect.


Access Date/Time fields don't really lend themselves to storing durations; for
one thing they're limited to 1 second granularity.

Rather than storing in a Date/Time field I'd suggest using a Number, Single
(rather than the default long integer) number of seconds. 1:30.66 would be
stored as 90.66. You can display it in n:ss.ss format using an expression like

[Runtime] \ 60 & ":" & Format([Runtime] - [Runtime] \ 60, "00.00")

and you can use two unbound textboxes on a form to enter minutes and seconds,
with a bit of code to combine them.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.