Problem with times...

  • Thread starter Thread starter GregM
  • Start date Start date
G

GregM

Good evening FNG here.
I have a table that stores 2 shrttimes and I thought it would be simple
enough to find the time span between the 2. Example time 1=15:00, time2
15:15 expr=[time2]-[time1]. Instead of getting the answer of 00:15 I am
getting this long drawn out decimal. Any insight anyone could provide would
be greatly appreciated.

Thanks in advance.
 
Greg,

It will display as you want if you format it to do so. Use the Format
property of the query field, or form or report control. Or else do it
in your query expression...
Expr: Format([time2]-[time1],"hh:nn")

- Steve Schapel, Microsoft Access MVP
 
Cool...That did it.

Could you recommend a good reference book for problems such as this?


Steve Schapel said:
Greg,

It will display as you want if you format it to do so. Use the Format
property of the query field, or form or report control. Or else do it
in your query expression...
Expr: Format([time2]-[time1],"hh:nn")

- Steve Schapel, Microsoft Access MVP


Good evening FNG here.
I have a table that stores 2 shrttimes and I thought it would be simple
enough to find the time span between the 2. Example time 1=15:00, time2
15:15 expr=[time2]-[time1]. Instead of getting the answer of 00:15 I am
getting this long drawn out decimal. Any insight anyone could provide would
be greatly appreciated.

Thanks in advance.
 
Greg,

There are many good books around. "Running Microsoft Access 2000" by
John Viescas is an excellent overview type book, even if you are using
a later version of Access.

Often, it is understanding a principle, rather than a specific
technique, that is important. In this case, the principle is that
Access stores date/time data as a number, being the number of days
since 30th December 1899. The integer part of the number reflects the
number of days, and the decimal portion reflects the proportion of the
day since midnight, i.e the time. The format only affects the way the
data is displayed, and does not change the data itself.

- Steve Schapel, Microsoft Access MVP
 
Many thanks.. I'll take a look at that book you recommended. I am aware of
the fundamentals of data storage and I was aware that Access stored that
data as a number. What I am struggling with is syntax. That is really what
I would like to brush up on.

Anywho...Have a good holiday and thanks.
 
Back
Top