How Do I Find The Difference Between 2 Times

May 12, 2006

Hi, I have the following expression in my query;

Worked Hours: DateDiff("h",[Start Time],[Finish Time])-[Breaks]

Start time and finish time appear as hh:mm and breaks is stored as a decimal i.e. 15min is 0.25, 30min is 0.5, 1 hour is 1.

The expression works fine when e.g Start 07:00 Finish 17:00 with breaks as 30min(0.5) gives the correct value of 9.5 hours worked but if the finish time was say 17:30, rather then show the correct value of 10 hours worked, it shows the wrong value of 9.5.

Could someone please tell me where I have one wrong and how to sort the problem, or offer me a different solution.

Thanks

View Replies


ADVERTISEMENT

Queries :: Number Of Hours - Calculating Difference Between Times

Jun 23, 2014

I am starting to create a resourcing database that needs to be able to work with dates and times and perform calculations on them.

I need to work out the number of hours. I have two date/time fields Day_Start_Time and Day_End_Time. I want to calculate the difference between the two in hours and then multiply by the number of working days.

I tried this: Number_Of_Hours: DateDiff("hh",[Day_Start_Time],[Day_End_Time])*[Number_of_days]

But get #Func! when I run the query.

View 3 Replies View Related

Queries :: Find Difference Between Multiple Fields In Two Tables

May 8, 2013

I have a database with two tables, one for the amount that was estimated in each cost section, and one for the actual amount billed for each cost section. The tables have the same number of fields, all with the same names. They can be linked together with event ID. Each table has over 100 fields and I would like to find the difference between what was estimated and what the actual was for each event. I would also like to see which cost section has the most and least variance. I am trying to do this without going through each cost and putting [tEst].[CostName]-[tActual].[CostName].

View 2 Replies View Related

Difference Between DAO And ADO

Apr 28, 2007

Could someone clarify the difference between DAO and ADO?

We migrated to Office 2003 last year - some large organizations move at the speed of continental drift. The database is written in Access 2002 (finally have most of it up and running - with thanks), but I need to really understand the difference for the documentation - to see if there are any issues that might undermine the database during the upgrade.

View 6 Replies View Related

Difference From Next Value

Feb 24, 2008

Hey

How can I calculate the difference between two rows like:

value____diff
4________4
7________3
12_______5

/Thanks

View 1 Replies View Related

Difference Between Two Tables ??

Jun 2, 2005

Hi, I have two tables, one being a subset of the other. What I want to do is write a query that lists data in the larger table that is not in the smaller one. In effect I want to subtract the data in the smaller table from the larger table and list the remainder.
I have tried something like:

Select a.oem from a,b where a.oem not in (select b.man from b);

This query does not complete and I get 100% CPU usage :( . The largest of the tables has roughly 4000 records in it. Any ideas? Am I doing something wrong?

Thanks

View 3 Replies View Related

Difference Between Dates

Jan 18, 2006

I have a Transactoin Table that holds the following fields:

TransID (*Primary Key Numerical Value)
OrderID (Non Unique Number Value, One Order can have multiple Transactions attributed to it.
Status (Numerical Value ranging from 0 to 32, each is a different phase in the life of a transaction such as 0 means Transation Created, 1 through 31 are various actions with 32 beign the transaction closing)
Date (The date in which a particular phase of a particular transaction happened.)
Reason (The Description of a phase. This is the only text field whose contents are relative to the Status field in the same table.)

I need to find the amount of time passed from the first Transaction to the last transaction of each individual order, which will be displayed in a report. Unfortunately not every order goes through all 32 phases, in fact most dont. The individual orders have a random amount of phases that they go through but each have a starting one (which ranges from 0 onwards) and an ending one (once again it is not necessarily 32). The dates correspond to the numbers in an individual order which means that if an order has the following phases:

1
2
4
6
Then the dates of each phase will be one after the other like the Status Number as shown above. Anybody knows how to do this? I need to find how much time passed from the first transaction to the last for each individual order qand display it in a report.

View 7 Replies View Related

Time Difference

Jan 30, 2006

This has probably been raised before but here goes anyway.

I have two fields in a table: time_in and time_out, both as date/time fields and formatted for short time with a mask in the form.

I need to calculate the time spent, i.e. time_in 10.00, time_out 12.15 therefore 2hours 15minutes.

any help much appreciated.

Jim

View 1 Replies View Related

Difference In Numbers

Aug 17, 2007

How can we calculate a difference of column

Example

when I have a table containing a single row i.e.

Numbers
66
45
23
52
523
563
452
133

Now I required a query that must show a difference like this

Numbers ------------------ Difference
66 ------------------------ 0
45 ------------------------ -21----------- (45-66)
23 ------------------------ -22 ------------(23-45)
52 ------------------------ +29 ------------ (52-23)
523 ------------------------ +471----------- (523-52)
563 ------------------------ +40 ------------ (563-523)
452 ------------------------ -111 ----------- (452-563)
133 ------------------------ -319 ------------(133-452)

So it is possible or not
Please tell me
Waiting for reply

Thanks
Ashish

View 2 Replies View Related

Difference In Field

Mar 25, 2008

hey guys im not even sure if i have the heading right for this one.
I have a table example data attached,

what i would like to do is return all transfers from that table where all the item numbers in a batch dont equal each other i.e if you subtract them all in a batch it doesnt = 0

i have know idea how to do this and dont know if this is even the right way of doing what i need which is to show transfers where some1 has transferred a product to a different one which we do want to have happen we just need to know when it was done.

any suggestions?

View 2 Replies View Related

Changing Times???

Jan 5, 2006

We use a device called a site master to test frequency levels across a system. This device stores plots onto graphs which are then downloaded onto an Access (95) database. When the plots are captured before they are put into the database they are time and date stamped among other things. When I open the Database in access I can go into the fields and physically change each of the dates. Yet when I use the site master software to open the database the Time and Date stamp appear at the bottom as the original values and not the changed values that I have assigned. Also when you right click the plots table and go to the properties. The created and modified dates have stayed as the originals. What I would like to be able to do is adjust this date. And what I would like to know is this possible??? Is it like a Windows File 'System' that is giving this date or is it a function in Access that can be changed?

View 4 Replies View Related

Extracting Times

May 17, 2005

I've got a field in a table called GenTime. It is in a Date/Time format, like 5/16/2005 7:00:00 PM.

What I need to do is extract from this field the time, like 7:01:00 PM to 7:59:00 PM. I just can't seem to make it work?? :(

Help!

View 3 Replies View Related

Overlapping Times

May 10, 2007

Here's a good one for the experts...

I have a query that sums downtime on equipment. The problem that I came across is that there can be multiple status items open up on the same piece of equipment. When the restored time on one status item occurs after the down time of another, the query still adds the total down time of both status items which is giving me greater downtime than there actually is.

Is there a workaround for this?

Thanx,
MJ

View 3 Replies View Related

Queries :: Sum Between Two Times

Nov 22, 2013

I work for a chemical company, over the course of the day there are 2 shifts, one from 07:00 - 19:00 and the other from 19:00 - 07:00. I want to measure the amount of time a piece of equipment has been offline for, and Sum these times for each shift, these pieces of equipment can go offline multiple times per day which is why I need the sum function. The fields I currently have are:

[Date1] : The date at which it went offline
[Time] : The time at which the piece of equipment went offline
[Duration] : The length of time it was offline for

For each day I wish to sum the offline time in two fields called:

[Shift 1]: The previous nights shift (between 7pm the day before and 7am that day).
[Shift 2]: The days shift (between 7am and 7pm that day).

Where to begin but the logic should be something like:

[Shift 1] = Sum of [Duration] For(([Date1]-1 and [Time] between 19:00 and 23:59) And ([Date1] and Time between 00:00 and 07:00))

[Shift 2] = Sum of [Duration] For([Date1] and [Time] between 07:00 and 19:00)

I currently have two tables storing all this data, one containing [Date1], and another containing the breakdown information such as [Duration], [Time] etc. They are linked by the [Date1] relationship. The reason for the first table only having the [Date1] field is because it is a Main Form which contains various sub-forms.

View 3 Replies View Related

Queries :: Between Two Times Within IF

Mar 29, 2014

I am trying to build a query that depending on the value stored in a combo box called SHIFT, either lists all the entries that have been made by our dayshift (07:00-19:00) or our night shift (19:00-07:00)

Each of these components work if I seperate them out

IIf([forms]![FRMFRame74]![SHIFT]=1,Between #07:00:00# And #19:00:00#,Between #19:00:01# And #23:59:59# And Between #00:00:00# And #06:59:59#)

View 2 Replies View Related

Midpoint Of Two Times?

Jun 21, 2014

A function I can use to calculate the midpoint between two times? (i.e. starting point, plus the total hours divided by 2)

Examples:
11PM to 4AM = 1:30AM

4PM to 5PM = 4:30 PM

7PM to 9:30PM = 8:15PM

View 5 Replies View Related

Queries :: Find A Way For Access To Find Unique Dates And Unique Names?

Aug 1, 2014

I have been working on a simple data base for some time now (beginner level) and am still trying to improve it. I would like to do something but before that I would like to have your opinion to know if it is even possible?I have a query QryMainReport:

Start Date/Time
End Date/Time
Employee

At the moment this is what the format of my report looks like (I removed other unnecessary fields):

StartTime----------EndTime---------------Employee
12/06/2014 01:00--12/06/2014 03:00------John Smith
12/06/2014 04:00--12/06/2014 06:00------Jane Doe
13/06/2014 02:00--13/06/2014 05:00------John Smith
13/06/2014 08:00--13/06/2014 08:00------Jane Doe

I would like to do as a report. (Dates would always be from Sunday to Saturday). I am not sure it is possible to do that. I suppose first it would mean:I would have to do a query to separate the times from the dates?I would have to find a way for Access to find the unique dates and unique names?Does it mean I have to use cross tab queries?

View 2 Replies View Related

Sequential Numbering With A Difference!

Oct 12, 2005

I have an existing table with a field labelled Job Number (17 Job Numbers). Each month I import a new table and match each record via another field (serial number). For each new record, one or many, I want to attach a sequential Job Number. In this example the new job numbers need to start at 18 then 19 etc. How is this possible? I am fairly new to Access so please be gentle!. Cheers

View 2 Replies View Related

Time Difference Calculation

Mar 8, 2006

Hello:

I have a report with three text boxes:

Box 1 contains an employee's total weekly hours in hours and minutes: 40:00
Box 2 contains the actual total hours worked for the week: 35:30
Box 3 is the difference between Box 1 minus Box 2

I tried all the date/time functions to calculate the difference between Box 1 and Box 2 and none of them worked. I keep on getting an error message. Does anybody know how to calculate the difference between two sets of time (in hours and minutes)?

Thank you in advance.

View 2 Replies View Related

Autogenerarte A Number But With A Difference

Apr 13, 2006

Folks,

Newbie to this forum so please be gentle. I am a relative newbie to acces but i seem to be picking it up quite quickly.

My problem is this:

I have an enquiry form made up and a button on the form that will generate a number by using the following code:

Private Sub EnqGen_Click()
On Error GoTo Err_EnqGen_Click

Me![Enquiry Number] = NewEnqNum()
Me![Customer Name].SetFocus
Me![Enquiry Number].Enabled = False

Exit_EnqGen_Click:
Exit Sub

Err_EnqGen_Click:

MsgBox "Error " & Err & ": " & Error$
Resume Exit_EnqGen_Click

Exit Sub

End Sub

Public Function NewEnqNum() As Long
On Error GoTo NextEnq_Err

Dim lngNextEnq As Long

lngNextEnq = DMax("[Enquiry Number]", "Enquiry") + 1

NewEnqNum = lngNextEnq

Exit_NewEnqNum:
Exit Function

NextEnq_Err:

MsgBox "Error " & Err & ": " & Error$
Resume Exit_NewEnqNum

Exit Function


End Function

This code works perfectly and generates a new enquiry number for me.

The end user now wants to change the format of the number to read like this 06-0001, whereas before i was using 60001.

What i would like to know is there anyway i can increment the last 4 digits only? i.e remove the first 3 digits, 06-, increment the 0001 by 1 then reassemble them back together.

Thanks for your help.

View 4 Replies View Related

Calculate Difference Between Values

Jul 17, 2006

How do I calculate the values between two columns and populate a third column with those new values? I have an ''Actual Cost'' column and ''Budget Cost'' column and I would like to create a third column ''Margin.''

Is this something that needs to be done with a query or can it be handeled in the design view of a table? I'm starting to learn that Access works nothing like Excel.

Thank you in advance for any help. I scanned some of the threads in this forum, but many were beyond my comprehension. Any walk-through of this procedure would be much appreciated.

View 1 Replies View Related

Date And Time Difference

Jan 12, 2007

I have four fields

Date Sent (date) Time Sent (Time) Date Recvd (date) Time Rcvd (time)

I want to know how many hours have elapsed between date and time sent and date and time rcvd


Any Ideas please as I am having a blonde moment

View 14 Replies View Related

Difference Between Post And Thread

Mar 15, 2007

Hi guys am not sure if i got dis in d correct forum (forgive me if not)

Just wanted 2 know what's d diff btwn a thread & a post (if d's any)

Noks

View 6 Replies View Related

Difference In 2 Consecutive Records

Jun 18, 2007

Hi there

I am trying to get a very simple thing done in Access and I must have spent almost over 2 days of Internet time to do so. My problem is that I need to get the difference in 2 records to show in a query.

e.g. MyTable has 2 fields: 1. MyDate 2. MtrReading

Everyday I enter date in MyDate and a number in MtrReading. And I need to find out the difference between today's MtrReading and Yesterday's Mtr Reading.

Any help is greatly appreciated!

Thanks

View 4 Replies View Related

Difference Between 'Call' And 'DoCmd'

Apr 8, 2008

Can someone tell me the difference between 'Call' and 'DoCmd' and how each are executed. For my level of programming, an newbie at that, I've used it interchangably so far without a problem. But I'm beginning to think that there is a difference. I don't want to later have to go back to redo my code down the line. I'm beginning to think that I've been very lucky so far in being able to use it interchangebly and my luck will run out soon.:eek:

View 7 Replies View Related

Size Difference, Normal?

Nov 3, 2006

Hello all!Maybe strange, but I have litterely created a new database from my "old" one. I did this because I thought the size of the database was growing way to fast.What I did was open two instances of Access, one with a new empty database open and one with the other "old" database open. I manually created all tables, queries, forms and code again by selecting everyting in design view, copying it, creating a new table/form/query/module in the empty database and pasting the data. After that I had to set some properties and it was ready to go. After compiling and compacting the new database was just 718kb in size. Empty that is. Then I added a couple of cases, compacted again, added some more, compacted again. (copies of the same data on different records). The same I did with the other "old" database.Both now have 12 clients with 2 cases (totalling 24 cases) every client and every case existing of the same data.The new database is now 1.120KB in size, the old one is 2.096KB. That's almost double. The only real difference between the two that I can think of is that one has a 20KB image tiled on the background of each form (the same image though) plus, of course, in the one database I've been designing, adding, deleting more.But how is it possible that these data sizes are so different? 100KB difference, ok. But almost double the size? How is that possbile and why? Are there things I can do to keep it at bay apart from using the Compacting and Reparing option? Plus: Is this normal?Edit: I emptied them. One is now 812KB in size empty, the other one is 1496 empty. Still... double the size. ?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved