Solved

How to calcualate lateness in Access 2010

Posted on 2016-11-29
11
43 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 24

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 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 24

Expert Comment

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

DateDiff ("m", "9:00", ActualStartTime)
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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 24

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 24

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 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Access creating a Chart from Search result on Form view 2 21
Help writing a query 6 73
Newbie needs help printing from a form. 10 20
Is it possible to reset DSum? 12 43
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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
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…

895 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

13 Experts available now in Live!

Get 1:1 Help Now