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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|