Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Total minutes
Mark Desens 
      
3 years ago
Hi guys, I have two fields in my table that are formatted to date/time. The third field is formatted number. I figured out how to use datediff in VBA to show the time difference between the two time fields. How do I format the third field to show it as hour and minutes using VBA. Thanks.
Kevin Yip  @Reply  
     
3 years ago
If the third number is an integer that indicates total minutes, you can get the hours (0-23) with division, and you can get the minutes (0 to 59) with the Mod function.  For instance, to convert 1393 minutes into hours and minutes, run:

    Dim T As Integer, h As Integer, m As Integer
    T = 1393
    h = Int(T / 60)
    m = T Mod 60
    MsgBox T & "m = " & h & "h " & m & "m"

and you will get:

    1393m = 23h 13m

The mod function returns the remainder of a division.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/1/2026 8:46:23 PM. PLT: 1s