Solved

Time math in Access

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

708 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

19 Experts available now in Live!

Get 1:1 Help Now