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 / Forms / October 2007

Tip: Looking for answers? Try searching our database.

How to use custom format [h]:mm like in excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jinks - 31 Oct 2007 15:32 GMT
How can I show a form in pivochart view summing the hours that passed between
two dates?

where is the excelent custom format [h]:mm???
Klatuu - 31 Oct 2007 15:44 GMT
In Access, you have to do it yourself.  First you need to use the DateDiff
function to get the number of minutes.

lngHrsAndMins = DateDiff("n",StartTime, EndTime)

Then you have to separate the hours and minutes.

strShowTime = Format(lngHrsAndMins \ 60, "00\:") & Format(lngHrsAndMins Mod
60, "00")

the \ divisor returns on the integer part and gives you the number of hours.
the Mod operator returns only the remainder part and gives you the number of
minutes.
Signature

Dave Hargis, Microsoft Access MVP

> How can I show a form in pivochart view summing the hours that passed between
> two dates?
>
> where is the excelent custom format [h]:mm???
jinks - 31 Oct 2007 16:39 GMT
When I do that I can obtain in a query the difference in hours between two
dates, but I can't show it in a pivotchart, because I can't sum the
"showtime", because is a string.

> In Access, you have to do it yourself.  First you need to use the DateDiff
> function to get the number of minutes.
[quoted text clipped - 14 lines]
> >
> > where is the excelent custom format [h]:mm???
Klatuu - 31 Oct 2007 16:43 GMT
then just leave it as a number and don't format it.
Signature

Dave Hargis, Microsoft Access MVP

> When I do that I can obtain in a query the difference in hours between two
> dates, but I can't show it in a pivotchart, because I can't sum the
[quoted text clipped - 18 lines]
> > >
> > > where is the excelent custom format [h]:mm???
 
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.