Queries :: Time Duration Over Midnight In Decimal Hours
Dec 22, 2014
I want to calculate decimal hours duration taken for a job starting before and finishing after midnight.
I have something that works but it seems cumbersome.
Hour(Format([Job]![Start_time]-1-[Job]![Finish_Time],"Short Time"))
+ (Minute(Format([Job]![Start_time]-1-[Job]![Finish_Time],"Short Time"))/60)
View Replies
ADVERTISEMENT
Dec 23, 2014
I have a query result for example = 2.19 days worked. The result of cumulated hours divided by 8 (hours in the workday). What I want to do is take the .19 and multiply it by 8 (hours in the workday) and I would have the result in actual hours which is what I need. Or of course if there is a way to display that into 2 days and 1.52 hours Rounded up to quarters would be even better. But with spending hours looking through forums I didn't find a way to just work with the decimals right of the dot. Trim, format, Len didn't work for me, they all give me funny result.
View 7 Replies
View Related
Apr 23, 2015
I'm working on a utilization database and pulling Excel data from Cognos 8. I use Access formulas to separate hours and minutes because I want to use time (.30, .45 (minutes)) instead of quarterly increments (.25, .50). I've successfully segregated hours, because I also have to turn days into hours. When I try to calculate out a column just for minutes, my formula keeps the number of days and I don't know how to fix it so the column just shows the minutes.
An example is a job has a decimal time of 2.02083333, which when done correctly is 48 hours and 30 minutes. I get the 48 hours correct, but the minutes shows as 2.30 instead of 0.30. That inflates the total job time to 50.30. This is the calculation currently in my database to pull out minutes:
Minutes: Int(([Min]60)24) & "." & Format([Min] Mod 60,"00").
How do I get rid of the '2' in the 2.30?
Access 2010
View 2 Replies
View Related
Jan 29, 2014
I have a field that works out the difference in time between two fields. However, whenever the end time goes past midnight, it calculates the difference as a minus figure. I understand that this is because of the date issue, but I cannot seem to find a way around it.
Here is what I have so far:
time_of_referral field. This is the start time. It is a short time field that is filled in by the end user.
time_of_arrival field. This is the end time. It is a short time field that is filled in by the end user.
Text31 field. This is not visible to the end user, and has the following control source =DateDiff("n",[time_of_referral],[time_of_arrival])
Text33 field. This is an unbound text box with the following control source =[text31]60 & Format([text31] Mod 60,":00")
This works out the time difference and presents it as hours and minutes.
I have seen solutions that add a day to the end time, but unfortunately this does not work when the end time DOESN'T go past midnight. Some will go past midnight, some won't.
View 5 Replies
View Related
Jul 9, 2014
I have designed an access application that logs emails that come into a department. However, the team leader has asked me to create a report to work out if emails were answered within a 24 hour period.
Is there a method to do this. It is not something I have attempted to do within access before.
View 6 Replies
View Related
Jul 5, 2014
I am creating query that calculates time interval so that this is used to calculate pay. Employees clock in at [time_in] and clock out at [time_out]. Sometimes time_out is on the next day of time_in.So if is substract time_out - time_in I will get a negative number.I am therefore using the following formula to extract the time interval; Interval: Format([time_out]-[time_in],"Short Time")
this gives out a result such as 3:30 when in fact I would need 3.5 to calculate pay by multiplying with rate.How do I convert 3:30 to 3.5. From the searches I get that I need to multiple 3:30 by 24. But when in put done in the query Interval: Format([time_out]-[time_in],"Short Time")*24
View 8 Replies
View Related
Feb 18, 2014
Access Query. I am creating a time sheet / pay roll database and I want to be able to get a total of the daily hours in a query.
For example I have 'Mon Start' and 'Mon Finish' for Mondays in/out times and I have a 'Mon Total' which gives me the total hours worked for Monday.
The problem I have is that Mon Total only works if the hours are say between 07:00 and 17:00, anything after midnight (00:00) like 21:00 to 07:00 and 'Mon Total' goes crazy !!
At the moment 'Mon Total' is the result of CDate 'Mon Finish' - 'Mon Start' (bit rough I know).
View 3 Replies
View Related
Apr 15, 2012
what is the best way to record durations, not time?I want to have a table that records charging data such as below:
startDate
startTime
Duration
(hh:mm:ss)
15/04/2012
12:00:00
13:00:00
In this example you can see we started charging the device at 12pm on 15/04/2012 for 13 hours, from this I will be working out the endDate/time using dateAdd etc.Do I set the duration field up as a dateTime and if so how do I avoid the DB thinking that the field is a time and not a duration, meaning that the endDate would be 1pm on the 15/04/2012 instead of the correct 1am on the 16/04/2012?
View 6 Replies
View Related
Jun 20, 2007
I hv a access mdb which contains one column as "duration", data format as hh:mm:ss, e.g. 00:02:20 - 2 mins 20secs.
How could I calulate the average of the duration?
like sum of all duration fields / the ttl no of records.
View 1 Replies
View Related
Nov 29, 2014
I want to subtract 8 hours of work of the Result of employee work hours/
There is attachment...
View 3 Replies
View Related
Apr 13, 2014
I am building a database to enter staff phone statistics. As an example my fields would be - Name, Date, Staffed time, Available time, Aux time and then calculated fields to show the percentage of time i.e %Aux, %Available etc.
My problem is the formatting of the times entered as they are duration not time. Say staffed time is entered as 08:00:00 for 8 hours and Aux time 03:57:21. The only format I can see to suit is date time but then Access takes these entries as 8am and 3:57am is there a way to change this to work as duration hh:mm:ss?
View 6 Replies
View Related
Apr 10, 2006
Looking to have a time field that a user can enter how long they worked an issue. Format should be ##:##, but I'm afraid that if I use text, calculations will be impossible.
How does someone do this if it's expected that the value will frequently go over 24 hours?
View 5 Replies
View Related
Mar 27, 2006
Any Help!
I have fields that are time formated 99/99/99" "00:00;0;_ and I want to subtract them.
I need to get the results in two forms; first in Days and second in Hours. I have used the obvious subtract one from the other and it gives me days in a rounded numbeer, but the hours is not working out.:confused:
DB
View 4 Replies
View Related
Jun 27, 2006
I want to create a query that will calculate the following:
When a user enters a start time and an end time in 2 seperate fields (eg. 06:00 and 08:00) I want to automatically return how many hours fall between 00:00 to 01:00, 01:00 to 02:00, 02:00 to 03:00 etc through the 24 hour clock.
To give you a background why I want this, I'm creating a labour planning database that calculates the nuber of people available each hour in a warehouse. So when a user inputs 06:00 to 08:00 for overtime work I need the database to tell me 1 hour falls between 06:00 to 07:00 and 1 hour between 07:00 to 08:00.
I'm really struggling to come up with a solution to this one, any help would be appreciated.
View 1 Replies
View Related
Jan 22, 2006
Hi Guys
I need to create a method of calculating -week number,hours worked per week and a leiu hours total.
Explanation
Users enter their worked hours per day. I need to calculate the total hours worked per user per week and if this is greater or less than their contracted hours a record of this figure over a continual time period (or year).
Variables :- Time worked,Holiday hours,Leiu hours taken,Sick leave, Other authorised leave.
I realise that i'm asking on a lot but working for a charity has financial limits.
Attached the basic database-so far
Thanks in advance for your help
Row
View 4 Replies
View Related
Mar 13, 2006
I created a time clock module where you input the time in and time out and it takes the difference of the two to give total time worked. However the boss wants the time worked represented in hours and tenths of hours not minutes. How can I take the time, seperate the hours...find out how many tenths of an hour worked and then add the hours and tenths together.
View 2 Replies
View Related
Jan 29, 2007
Hi,
I am trying to show the time difference between 2 times but the calculation is not working correctly.
First I work out the totaltime on mins between 2 dates using datediff, then I am trying to convert to hours and minutes like :
Total_Time: Format([Sumoftotaltime_mins]/60,"00") & ":" & Format([SumofTotaltime_mins] Mod 60,"00")
This is working until I have something like :
03:00
15:45
25:20
this should work out as 44 hours and 5 mins but for some reason it is showing as 43 hours and 5 mins.
why would this be ?
View 4 Replies
View Related
Nov 2, 2004
Hi,
I have a bit of a problem. I am making a program in access 2002. In my program you should punch in hours:minutes, this is for keeping track of how long a job has taken to perform. The problem is that it could exceed 23:59, it could take up to a week or even more. In my database we have already put in a lot of info where it doesn't exceed the 23:59, I would like to keep this posts and just to put in new ones that I could use further on when I am about to take out reports, where I have to calculate time. Is there someone who knows what to do ??
Regards
Greger
View 6 Replies
View Related
Nov 19, 2011
I need to calculate in the tbleJobs table, the amount of the jobs total amount and place the result in the JobsTotalAmount field.
This has to be a manual calculation. Not an on event calculation.
Data is coming from two table:
tblLimos has the hourly rate.
tblJobs has the start time, the finish time and the total amount field.
View 6 Replies
View Related
Nov 28, 2011
I am using a database and need a field capable of storing times that will be greater than 24 hours.
I understand there is no "ready made" way of dealing with this in Access, so what's the best way?
The catch is I am using VBA code in Excel to populate the table, the value comes from a cell (in Excel formatted as "[h]:mm").
View 2 Replies
View Related
Aug 30, 2014
I am creating an access database for the results of my triathlon times and I am having trouble with the race results. Based on some information I found here, I am using number fields for the swim, bike and run times because I want to do calculations and also sort them and it doesn't sort properly if they are text.I have created separate fields for the hours, minutes and seconds for each of them.
Now I am trying to make a calculated field to convert the numbers to the following..For a swim time, I want to convert it to the time per 100m. I have the calculation for that, but the result gives me the decimal portion and not the actual seconds portion and I am stuck. Here is what I have so far :
Sw100m: (([SwMin]+([SwSec]/60)+[SwHr]/60)*100/750)
So as you can see I have added up all the number to get the total number of minutes and then converted to the minutes per 100m (the race is 750m). And the result gives me 3.31. But the .31 is a decimal and I want to have seconds which is 18 seconds. I know how to do the calculation on paper but I don't know how to change my formula to fix this. On paper I have to multiply .31 x 60. But how do I refer to the decimal portion of the number and modify my formula? how to input race times as duration in an access database.
View 11 Replies
View Related
Dec 20, 2013
I am trying to figure out how to take a table of timestamps and activity duration and break it into intervals, where it groups the duration into the time spent in each 15 minute interval. I have included a sample of the data and output. Is there any way to pull this in Access (or SQL)?
Raw Data
EmployeeActivityTimeStampStartTimeStampEndTotalDuration
Doe,JohnSomeActivity12/16/13 9:06:02 AM12/16/13 9:57:14 AM0:51:12
Smith,JaneOtherActivity12/16/13 9:22:15 AM12/16/13 10:06:55 AM0:44:40
Query to break out the total duration time in to the 15 minute interval it fell into
EmployeeActivityIntervalIntervalDuration
Doe,JohnSomeActivity12/16/13 9:00:00 AM0:08:58
Doe,JohnSomeActivity12/16/13 9:15:00 AM0:15:00
Doe,JohnSomeActivity12/16/13 9:30:00 AM0:15:00
Doe,JohnSomeActivity12/16/13 9:45:00 AM0:12:14
Smith,JaneOtherActivity12/16/13 9:15:00 AM0:07:45
Smith,JaneOtherActivity12/16/13 9:30:00 AM0:15:00
Smith,JaneOtherActivity12/16/13 9:45:00 AM0:15:00
Smith,JaneOtherActivity12/16/13 10:00:00 AM0:06:55
View 2 Replies
View Related
Nov 8, 2007
I have a query with 2 fields I wish to multiply together to get a value for a feild, [Hours_Lost]. One is a short time field and one is a number field. The short time field is [Hours] and the number field is [people] I have been trying the following but no luck. Abnyone any ideas?
Hours_Lost: [People]*(CDbl([Hours])*24)
View 6 Replies
View Related
Nov 13, 2007
I am trying to subtract 12 hours from a time-date field when the payperiod does not equal 01.
in a query I have:
work date: iif([payperiod]="01",[StartTime],[starttime]-#12:00:00#) - Access added a PM before the second hash so it looks like this:
iif([payperiod]="01",[StartTime],[starttime]-#12:00:00 PM#)
When I run the query I get a message box: "syntax error (missing operator) in query expression '00:00:PM#,2))". I am unable to open the query to correct the error. I can cop the unaltered query from a back up database.
My question is how do I subtract the 12 hours.
Thanks
Steve
View 3 Replies
View Related
Aug 1, 2013
I have a field in my report [Idle]
This has a time in a HH:MM:SS format (so 01:38:23)
What I need to be able to do is sum this greater than 24 hours and keep the format of HH:MM:SS - ideally I need to do this in the form field that I'll be using to sum it.
View 1 Replies
View Related
Sep 13, 2014
In my DB that we use and a workflow tool, some of our work has and due date and time.If we get the complete_package our work time starts and we have X amount of time to complete our work. This is something i worked on but set it aside, now i am coming back to try and fine tune this so it returns a more accurate value.
So if we receive and [Date_Complete_Package_Received] at 09/13/2014 09:00:00 AM and based on the work being done we have 5 hours to complete the work, then the [Date_and_Time_Complete_Package_DUE] would be 09/13/2014 02:00:00 AM. That part is simple and i have coding that does that just fine. [SLA_Time] is where it gets the amount of time allotted, we have 5,10,12,14,and 16 hours depending on what is being done.
Code:
Me.Date_and_Time_Complete_Package_DUE = DateAdd("h", [SLA_Time], [Date_Complete_Package_Received])
This is done on AfterUpdate of a field on one of my forms and it works the way it is but what i need is to be able to run this through my Workhours Function so i am not getting values that our in off hours.The following doesn't work i know i can't use the Workhours function with the DateAdd but this is just to show what i am trying to do.
Code:
Me.Date_and_Time_Complete_Package_DUE = WorkHours(DateAdd("h", [SLA_Time], [Date_Complete_Package_Received]))
I have a Workhours module and it is used for a lot of things and it works perfectly.
View 1 Replies
View Related