Adding Minutes and Seconds in Access

  • Thread starter Thread starter bdoiron
  • Start date Start date
B

bdoiron

Guest
I am writing an Access program to compile Cell phone billing information for my company that has around 60 phones. I am entering the detail information and reporting on it. The problem I am having is with the minutes and seconds calculations. For instance employee A might have accumulated 630:59 minutes for the current month and employee B might have 250:12 minutes (Mins Secs) for the current month and so on. I want to be able to enter these amounts in a feild and then be able to sum them. Can you tell me how to format the field that the detail minutes will be entered into. I have been looking on the net for hours for a solution. Also I need the sumation of the minutes to be in minutes not hours. Example

630:59
530:12 would be 1161.11 If this is possible, What would the data type and format of the field the data would be entered into?
Thanks
 
Try this...

Assuming a table [tblCellTime] with an Employee ID [EmpID], and a cell time field [CellTime]...

and that field [CellTime] is always in the format of (m)mm:ss

use a query to get your totals...

SELECT
tblCellTime.EmpID
, Sum(Left([CellTime],Len([CellTime])-3)) AS [Min]
, Sum(Right([CellTime],2)) AS Sec
, [Min]+[Sec]/60 AS MinFinal
, [Sec] Mod 60 AS SecFinal

FROM
tblCellTime

GROUP BY
tblCellTime.EmpID;

You will need to concatenate the two fileds on your form to give you the totals in your format mmm:ss.

HTH
 

Users who are viewing this thread

Back
Top Bottom