Solved

How to calcualate lateness in Access 2010

Posted on 2016-11-29
11
53 Views
Last Modified: 2016-11-29
Does anyone know how I calculate lateness by deducting Start Time from Actual Start Time?
0
Comment
Question by:LillyC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 29

Expert Comment

by:Pawan Kumar
ID: 41905344
Is this what you want ? difference in year / month or day ?

DateDiff ("yyyy", StartTime, ActualStartTime)

DateDiff ("m", StartTime, ActualStartTime)

DateDiff ("d", StartTime, ActualStartTime)
0
 

Author Comment

by:LillyC
ID: 41905353
Thanks but sorry this isn't what I'm looking for.  I want to auto calculate the Actual Start Time form the 'time they arrived' to show how late they are (in minutes).
0
 
LVL 34

Expert Comment

by:Norie
ID: 41905361
Where does 'time arrived' come from and what would you use along with it to calculate 'actual start time'?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:LillyC
ID: 41905368
The Actual Start Time will always be 9am and the arrival time will be entered manually, eg 9.30am, so I just wanted to create a field that auto calculates how late they are eg '30' minutes.
0
 
LVL 29

Expert Comment

by:Pawan Kumar
ID: 41905369
Do you want to use this in your query?

DateDiff ("m", "9:00", ActualStartTime)
0
 
LVL 34

Accepted Solution

by:
Norie earned 500 total points
ID: 41905373
Perhaps.

Lateness(m):DateDiff("n", TimeValue("09:00"), [Actual Start Time])
0
 

Author Closing Comment

by:LillyC
ID: 41905386
Perfect :) thank you.
0
 
LVL 29

Expert Comment

by:Pawan Kumar
ID: 41905391
Hi Lilly C,
I provided that solution and Norie just added TimeValue and you ignored my solution. Is this fair?

It is clearly visible that I provided all the inputs even the question was not clear.

Regards,
Pawan
0
 

Author Comment

by:LillyC
ID: 41905466
Hi Pawan

I didn't ignore your solution, I copied it into my query and it didn't work, I then copied Nories solution into my query and it did work.

I'm sorry my question was not clear and I don't mean to offend you by not accepting your solution, but on this occasion your solution didn't work for me.

Regards

Lilly
0
 
LVL 29

Expert Comment

by:Pawan Kumar
ID: 41906248
Hi Lilly,
At least you can see that the other expert has change my code a bit. That is quite visible.  Anyways no issues :), Also learn the technique and the logic behind the statement you used. Copy paste will not help down the line.

Bye, Regards,Cheers !!
Pawan
0
 
LVL 34

Expert Comment

by:Norie
ID: 41906772
Pawan

I didn't copy your code.

After I'd clarified what was required I went away to work on a solution.

I then returned and posted what I came up with.

Unsurprisingly I used DateDiff as you did since that's the standard way to calculate date/time difference in Access.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question