Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Time math in Access

Posted on 2016-07-21
2
Medium Priority
?
75 Views
Last Modified: 2016-07-21
I have a field that is a sum of time formatted hh:nn:ss. The time represents time out. I need to get a percentage of availability over 59 days, which should be 1416:00:00 hours. So I need 1416;00:00-totaltime/1416:00:00. Can't seem to get this to work correct from an Access query. I'm sure it's a syntax issue.
0
Comment
Question by:dgravitt
[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 39

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 41723557
I'm not sure I understand what you are looking for but a DateTime field represents a point in time, not an accumulation of time.  Access will only show up to 24 hours if you are trying to format the DateTime field.  If you need something different, you will need to create your own function.  Dates are stored as double precision numbers with the whole number being the number of days since 12/30/1899 and the decimal counting time since midnight.

print now()
7/21/2016 2:01:31 PM
print cdbl(#7/21/2016 2:01:31 PM#)
 42572.5843865741

so 2:01:31 = .5843865741 and 42572 = 7/21/2016

Once you add more than 24 hours, you start increasing the integer
0
 

Author Closing Comment

by:dgravitt
ID: 41723596
thanks
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

704 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