Solved

Time math in Access

Posted on 2016-07-21
2
50 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 36

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

830 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