?
Solved

Difference between two times

Posted on 2013-11-29
2
Medium Priority
?
430 Views
Last Modified: 2013-11-29
Hi,

I am using DateDiff in Access 2010 to show the time difference between 2 times.

Minutes: DateDiff("n",[ClockInTime],[ClockOutTime])

The above works fine, unless ClockOut time is after midnight, in which case I get a negative and inaccurate result.

Can anyone tell me how I need to modify this simple query so that when I run it I get the correct results.

Thanks
0
Comment
Question by:LJShepherd
[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
2 Comments
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39685199
Hi,

pls try (supposing it cannot be more than 24 hours)

Minutes: DateDiff("n",[ClockInTime],IIf([ClockOutTime]<[ClockInTime],[ClockOutTime]+1,[ClockOutTime]))

Open in new window


Regards
0
 

Author Closing Comment

by:LJShepherd
ID: 39685213
Brilliant, works perfectly thank you!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

765 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