Solved

Time math in Access

Posted on 2016-07-21
2
36 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
2 Comments
 
LVL 34

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

861 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now