Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 66
  • Last Modified:

How to calcualate lateness in Access 2010

Does anyone know how I calculate lateness by deducting Start Time from Actual Start Time?
0
LillyC
Asked:
LillyC
  • 4
  • 4
  • 3
1 Solution
 
Pawan KumarDatabase ExpertCommented:
Is this what you want ? difference in year / month or day ?

DateDiff ("yyyy", StartTime, ActualStartTime)

DateDiff ("m", StartTime, ActualStartTime)

DateDiff ("d", StartTime, ActualStartTime)
0
 
LillyCAuthor Commented:
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
 
NorieVBA ExpertCommented:
Where does 'time arrived' come from and what would you use along with it to calculate 'actual start time'?
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
LillyCAuthor Commented:
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
 
Pawan KumarDatabase ExpertCommented:
Do you want to use this in your query?

DateDiff ("m", "9:00", ActualStartTime)
0
 
NorieVBA ExpertCommented:
Perhaps.

Lateness(m):DateDiff("n", TimeValue("09:00"), [Actual Start Time])
0
 
LillyCAuthor Commented:
Perfect :) thank you.
0
 
Pawan KumarDatabase ExpertCommented:
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
 
LillyCAuthor Commented:
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
 
Pawan KumarDatabase ExpertCommented:
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
 
NorieVBA ExpertCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 4
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now