?
Solved

How to calcualate lateness in Access 2010

Posted on 2016-11-29
11
Medium Priority
?
55 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
Technology Partners: 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 2000 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

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!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

800 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