converting a number into time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top