473,387 Members | 1,579 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,387 software developers and data experts.

output decimal as days:hours:minutes

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 take to run
(on a machine which runs at a given number of copies per minute). I
have seen very short, control source statement that will format to
hours:minutes, but I do not know how to make it format to
days:hours:minutes, and most of the jobs this database will be used
for will run over days. The way I have it set up, I get something
like 13.72 instead of 1 day: 13 hours: 43 minutes.

Here is a sample of the control source code I've seen used for a
similar problem on another forum (to solve hours:minutes).

= int([FieldName]) & Format((([FieldName] - int([FieldName]))) * 60,"#:
00")

That works great for the hours/minutes if it is less than 24 hours.
Over that, and it doesn't roll over into days.

Feb 6 '07 #1
1 4155
Doug Steele has a more complete DateDiff() function here:
http://www.accessmvp.com/djsteele/Diff2Dates.html

For a basic explanation of what's going on, see:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<ba*****@yahoo.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
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 take to run
(on a machine which runs at a given number of copies per minute). I
have seen very short, control source statement that will format to
hours:minutes, but I do not know how to make it format to
days:hours:minutes, and most of the jobs this database will be used
for will run over days. The way I have it set up, I get something
like 13.72 instead of 1 day: 13 hours: 43 minutes.

Here is a sample of the control source code I've seen used for a
similar problem on another forum (to solve hours:minutes).

= int([FieldName]) & Format((([FieldName] - int([FieldName]))) * 60,"#:
00")

That works great for the hours/minutes if it is less than 24 hours.
Over that, and it doesn't roll over into days.
Feb 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Deepa | last post by:
I need a routine to convert milliseconds to a traditional dd:hh:mm:ss or four separate variables that I can display. I am not wanting to display a date but rather the interval between two...
7
by: Stu | last post by:
Is there a simple function call within "C" that I can use to convert number of seconds (keep in mind this may be a type longlong and has to work on UNIX and NT) into Days, months, Hours, Minutes...
2
by: J M | last post by:
I rebooted a network device just few minutes ago and getting device-up-time value 3191. How do I convert a time elapsed in days hours minutes and seconds for above value? Example: This device...
1
by: markdp | last post by:
I'm trying to write a program that takes a user inputted number of seconds and converts it into hours, minutes and seconds. So for instance, the program prompts the user for seconds, lets say 1000...
1
by: Lorisabel | last post by:
I would like to ask for some help with this assignment as i don't know how to start it. Write a C++ program that prompts the user to input the elapsed time for an event in seconds. The program...
1
by: Bert Murphy | last post by:
I need help with code that would allow input in seconds (as many time as you would like) and would keep a running total of the output in the form of Hours:Minutes:Seconds as well as subtracting...
2
by: mar10 | last post by:
i have TIME WORKED stored as minutes - I'd like to convert this to days,hours,minutes. I'm currently converting to hours and minutes but have not had success adding the days portion to the...
1
by: pyett101 | last post by:
hello everyone. im new to the forum and just started learnign c++ but im stuck with a problem. i want to write a simple program that takes a number of days, hours and minutes and converts them to...
5
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I have about ten integer values that each need to be converted to days, hours, minutes and seconds. I can't seem to find a formula for same that works. These integer values come from a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.