Solved

How to calcualate lateness in Access 2010

Posted on 2016-11-29
11
25 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
  • 4
  • 4
  • 3
11 Comments
 
LVL 17

Expert Comment

by:Pawan Kumar Khowal
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 33

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
 

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 17

Expert Comment

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

DateDiff ("m", "9:00", ActualStartTime)
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 33

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 17

Expert Comment

by:Pawan Kumar Khowal
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 17

Expert Comment

by:Pawan Kumar Khowal
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 33

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Error compiling fairly simple database 3 16
Dcount unique 6 22
formattig excel from access 3 17
Search field on a form 7 14
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now