PC Review


Reply
Thread Tools Rate Thread

Converting Hours in decimal format to Hours and minutes (short time)

 
 
Gina
Guest
Posts: n/a
 
      26th Sep 2007
I want to find the elappsed time betwin StartTime and EndTime which
are in a table. I can get the answer in a Form using the startTime
and endTime with ' =([EndTime*1]-[StartTime]*24)', but the answer to
that function naturally is in decimal hours. e.g. StartTime is 08:00,
EndTime is 17:23 and the form result returns 9.5333333. That's great,
the function works, but now I want to get it back in ti 'short time'
fornat so that the answer to the example would read 9:23.
 
Reply With Quote
 
 
 
 
Pieter Wijnen
Guest
Posts: n/a
 
      26th Sep 2007
divide timepart by 24?

Pieter

"Gina" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I want to find the elappsed time betwin StartTime and EndTime which
> are in a table. I can get the answer in a Form using the startTime
> and endTime with ' =([EndTime*1]-[StartTime]*24)', but the answer to
> that function naturally is in decimal hours. e.g. StartTime is 08:00,
> EndTime is 17:23 and the form result returns 9.5333333. That's great,
> the function works, but now I want to get it back in ti 'short time'
> fornat so that the answer to the example would read 9:23.



 
Reply With Quote
 
rquintal@sympatico.ca
Guest
Posts: n/a
 
      26th Sep 2007
On Sep 26, 7:47 am, Gina <naging...@hotmail.com> wrote:
> I want to find the elappsed time betwin StartTime and EndTime which
> are in a table. I can get the answer in a Form using the startTime
> and endTime with ' =([EndTime*1]-[StartTime]*24)', but the answer to
> that function naturally is in decimal hours. e.g. StartTime is 08:00,
> EndTime is 17:23 and the form result returns 9.5333333. That's great,
> the function works, but now I want to get it back in ti 'short time'
> fornat so that the answer to the example would read 9:23.


If the data is stored in date/time type fields, usae the datediff()
function to return the difference in minutes. Once you have that, you
use a user defined function to extract the number of hours, and the
number of minutes, then format each as two digit numbers.

=Format(datediff("n",startTime,EndTime)\60,"00") & ":" &
Format(datediff("n",startTime,EndTime) mod 60,"00")




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with converting decimal time to hours and minutes =?Utf-8?B?Um9iZXJ0U0U2?= Microsoft Excel Misc 6 22nd Oct 2007 01:00 PM
Converting time format in hours mins to minutes =?Utf-8?B?WmFreW50aG9z?= Microsoft Excel Programming 4 23rd Mar 2007 02:48 PM
Converting a decimal time into hours and minutes =?Utf-8?B?TGl6SG91Z2g=?= Microsoft Excel Worksheet Functions 1 4th Jul 2006 11:00 AM
Converting Time from Hours:Minutes to number of hours =?Utf-8?B?TGVzbGll?= Microsoft Excel Misc 3 24th Aug 2004 05:49 AM
Re: Converting hours into hours minutes format Dirk Goldgar Microsoft Access 1 13th Jan 2004 08:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 AM.