Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Conversion / January 2004

Tip: Looking for answers? Try searching our database.

Time duration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
teyterry@hotmail.com - 18 Jan 2004 23:49 GMT
With Access 2002, how do you calculate the time
difference into hr:min or just minutes?  For example,
from Dec 21st 2002, 0200h till Dec 21st 2002, 0315h.  And
between Jan 2nd 2004 2300h till Jan 3rd 2004 0110h.

Thank you.
Ken Snell - 19 Jan 2004 02:46 GMT
To get the minutes of the duration, use the DateDiff function:

MinutesElapsed = DateDiff("n", StartDateTime, EndDateTime)

You can divide this result by 60 to get hours and fractions of hours.

To get the display as hh:nn (hours:minutes):

DisplayResult = Format(DateDiff("n", StartDateTime, EndDateTime) \ 60, "0:")
& _
   Format(DateDiff("n", StartDateTime, EndDateTime) Mod 60, "00")

Signature

      Ken Snell
<MS  ACCESS MVP>

> With Access 2002, how do you calculate the time
> difference into hr:min or just minutes?  For example,
> from Dec 21st 2002, 0200h till Dec 21st 2002, 0315h.  And
> between Jan 2nd 2004 2300h till Jan 3rd 2004 0110h.
>
> Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.