473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How can I change decimal time to days hr min

Hope someone there could help me. I'm relatively new in Access and have a problem. I Have a Date/Time Out for equipment and a Date/Time Back for equipment. My Query calculates as:

Example:(2/17/09 12:00:00 PM)-(2/6/2009 12:00:00 PM)
Answer:11...in days
Example:(1/5/09 1:30:00 PM)-(5/18/09 1:00:00 PM)
Answer:132.979166666664
How can I change this into 132 days .5 hrs/or 30minutes

Example:(2/17/2009 09:45:00 AM)-(2/17/2009 09:00:00 AM)
Answer:0.03125
How can this be changed to .45/or .75
What formula do I use and when do I enter it.
Oct 15 '10 #1
7 2677
NeoPa
32,556 Expert Mod 16PB
Any value in days can easily be converted to hours by the simple expedient of multiplying it by 24.
Oct 15 '10 #2
In my query:
DateTime_Calculation: ([DateTime_In:]-[DateTime_Out:])
Where do I multiply by 24. DO I open a new field? Do I make a new query? Do I multiply total on the Text box on of the FORM? I don't have any experience and am grasping at straws... Please help
Oct 15 '10 #3
NeoPa
32,556 Expert Mod 16PB
Try :
Expand|Select|Wrap|Line Numbers
  1. DateTime_Calculation: ([DateTime_In:]-[DateTime_Out:]) * 24
Oct 15 '10 #4
([5/18/2009 1:00:00 PM]-[1/5/2009 1:30:00PM])*24 Answer went from 132.979166666664 to 3191.49999999994 not into 132 days and .50 / or .30 minutes Ghee I wish I knew what I was doing? Was I suppose to add *24 to query calculation? Sorry If I sound desperate but I've been on this problem for a WHILE
Oct 15 '10 #5
NeoPa
32,556 Expert Mod 16PB
Ah. I think I have a better idea now what you were trying to ask for :-
The whole number of days then the fraction displayed as hours etc.

That's not so easy as the days and hours etc would need to be done quite separately. Here's what I have for the whole caboodle. You can work out exactly what you need from there :
Expand|Select|Wrap|Line Numbers
  1. DateTime_Calculation: Int([DateTime_In:]-[DateTime_Out:]) & Format([DateTime_In:]-[DateTime_Out:], " \Da\y\s H \hour\s, m \mi\nute\s, ss \se\co\n\d\s")
Oct 15 '10 #6
Oh I can't believe it finally works. It's been a long process on getting this to work. You have really taught me a real lesson in how a query works....Thanks,Thanks, Thanks so much.....
Oct 18 '10 #7
NeoPa
32,556 Expert Mod 16PB
It's a pleasure Marie.

It's also a very good indicator for future questions about how important it is to get the question right and clear in the first instance. I doubt you'd have experienced the delays if the question had been clearly understood from the start. We see this a lot, where people struggle for answers, even when many of us have them, simply because the question isn't recognised for what the questionner is trying to ask.
Oct 19 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Wilfried Mestdagh | last post by:
Hi, I have something like this: string S = dblN.ToString("F4") and S contain the decimal point as in the windows setting (currently ',' on this machine). But I want it to be let's say: '.'...
1
by: Srinivas Kollipara | last post by:
Hello all, i have a problem to change system time programatically in C#. Can Any one help me with that. thanks -- Srinivas L.Kollipara
4
by: jensen bredal | last post by:
Hello, Is there a way to dynamically select how often my page should be refeshed? Any comment will be higly appreciated. Thanks JB
1
by: juky | last post by:
Hi all, I'm using WMP 10 SDK with vb.net and I need to reduce the buffer time. By default is setting to 5 seconds. How can do it within my code ? Thanks, Juky
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
1
by: baneaic | last post by:
I'm trying to create a form that will allow a user to enter certain job specifications (# of pages and # of copies) and then have a field that will automatically calculate how long that job will...
2
by: hunslair | last post by:
This is a really basic question. I am taking a teach yourself beginners course on Access 2003 and have run into a road block on one practice. In a select query, I have created a simple calculation...
11
by: elliotmf | last post by:
Hello, I need a format function for a query that will Convert: Decimal Time to Regular Time. For Example my Database stores 8 Hours and 15 Min as: 8.25000008940697 And now I need a...
3
by: kolhapur | last post by:
hello, i want to change session time.the session time should differ according to section of my module. i have tried with these function ini_set('session.gc_maxlifetime'), ...
1
by: KALEL KANATA | last post by:
How do I change this time duration 1.80 into this 2.20 in my DB2 query results I have a table that gives me time spent in the form of 1.80 meaning 1 hour and 80 min I have a query that pulls...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.