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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I convert time (hh:nn:ss) into the total minutes?



 
 
Thread Tools Display Modes
  #11  
Old July 21st, 2009, 09:48 PM posted to microsoft.public.access.gettingstarted
Cynthia
external usenet poster
 
Posts: 236
Default How do I convert time (hh:nn:ss) into the total minutes?

OK - am trying to create a report to invoice for each long distance code
entered, duration is a field in my phone data table(duration properties are
set to Format: hh:nn:ss )
- so I have made a query to filter for the data I need show on the report
- within the report I have created a field that is called Time, I put the
calculation into the Time field; The report is running off the query



"John Spencer" wrote:

Since you did not show us where or how you used the expression, it is really
difficult to diagnose.

Is Duration a FIELD in your table or query?

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Cynthia wrote:
Ok so I used =Int([duration]*1440) and the outcome is 12:00:00 AM for each
entry - any ideas why it would do this?



  #12  
Old July 21st, 2009, 11:41 PM posted to microsoft.public.access.gettingstarted
Cynthia
external usenet poster
 
Posts: 236
Default How do I convert time (hh:nn:ss) into the total minutes?

Figured it out - I created a new field in my query called Length and defined
it as the equation

Thanks for the reccommendation


"Cynthia" wrote:

OK - am trying to create a report to invoice for each long distance code
entered, duration is a field in my phone data table(duration properties are
set to Format: hh:nn:ss )
- so I have made a query to filter for the data I need show on the report
- within the report I have created a field that is called Time, I put the
calculation into the Time field; The report is running off the query



"John Spencer" wrote:

Since you did not show us where or how you used the expression, it is really
difficult to diagnose.

Is Duration a FIELD in your table or query?

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Cynthia wrote:
Ok so I used =Int([duration]*1440) and the outcome is 12:00:00 AM for each
entry - any ideas why it would do this?



  #13  
Old July 22nd, 2009, 11:46 AM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default How do I convert time (hh:nn:ss) into the total minutes?

Use TimeValue([duration]) * 1440

Int does the exact opposite of what you want: it removes the time, not the
date!

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Cynthia" wrote in message
...
Ok so I used =Int([duration]*1440) and the outcome is 12:00:00 AM for each
entry - any ideas why it would do this?

"John Spencer" wrote:

As long as the field contains only a time, you can multiply that time by
1440
to get the minutes. If the field contains seconds also then you might
get
fractional parts of a minute. You can decide if you want to truncate the
partial minutes or not using the int function

The expression
Duration * 1440
will give you the number of minutes and partial minutes if any seconds

The expression
Int(Duration * 1440) will truncate the partial minutes

The expression
Round(Duration * 1440,0)
will round up or down the minutes

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Cynthia wrote:
So would I just multiply by field by 1440?

"John W. Vinson" wrote:

On Tue, 21 Jul 2009 09:47:43 -0400, John Spencer
wrote:

I'm puzzled. Did you mean multiply the time by 1440 to get the
number of minutes?
#13:15:00# * 1440 returns 795 which is the number of minutes since
midnight
Exactly... thanks for the catch, John, it had been too many minutes
since I'd
had coffee!
--

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:14 AM.


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