converting a number into time

A

alekm

Hi,
I've got something like
SELECT (stop - start ) FROM table1; where stop and start are date/time
for example

I get:0,239583333333333 for start:7:15:00 stop13:00:00
How do I convert result to appropriate result: 5:45:00

alek_mil
 
N

Nikos Yannacopoulos

What you get is because Access (actually, all of Office) stores date and
time as a number, the integer part being days since 12/31/1899, and the
decimal part being the time (1 = 24 hrs, 0.25 = 6 hrs etc). so, the
result you get is correct, you just need to format it:

SELECT Format(stop - start, "hh:nn:ss") FROM table1;

HTH,
Nikos
 
E

Ed Warren

What 'interval' are you interested in as a result (days,
weeks,minutes,years)?
you can use:
Select
ReturnFieldName:DateDiff("d",[start],[stop]) to get the number of days
between the dates. Changing the "x" parameter will allow you to return
almost whatever interval you need (see help files under datediff)

Ed Warren
 
Top