Solved

Time math in Access

Posted on 2016-07-21
2
63 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 37

Accepted Solution

by:
PatHartman earned 500 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

705 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