473,385 Members | 2,028 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,385 software developers and data experts.

Converting information from days to hours and minutes

I have a table where I have fields name START DATE and SHUT OFF DATE with the data type at Date/Time and it's format set to General Date so that I can record both date and time of starting and shutting off. I created a query that I added an expression [SHUT OFF DATE] - [START DATE] to figure out total time the irrigation system was running - it gave its answer in days - how can I convert this answer to hours and minutes instead?
Jul 29 '08 #1
3 1771
missinglinq
3,532 Expert 2GB
You need to get elapsed time in minutes (I'm assuming that's as fine as you want to cut it) using DateDiff(), then parse it out, something like this:

Expand|Select|Wrap|Line Numbers
  1. TotalMinutesElapsed = DateDiff("n",[Start Date], [Shut Off  Date])
  2. HoursElapsed = TotalMinutesElapsed\60
  3. MinutesElapsed = TotalMinutesElapsed mod 60
  4.  
Be sure to notice the back slash in the HoursElapsed formula. This causes Access to return only the interger (hours) portion of the division.

Welcome to Bytes!
Linq ;0)>
Jul 29 '08 #2
Thanks a bunch. I have limited knowledge of coding - where would I enter the DateDiff() and the code following it - in the query, right? Sorry for my limited knowledge and thanks for your help
Aug 12 '08 #3
hjozinovic
167 100+
If you want to use query you can try with Format function.
in the field having formula [HTML][Shut Off Date]-[Start Date][/HTML]
try replacing with [HTML]Format([Shut Off Date]-[Start Date];"hh:mm:ss")[/HTML]
Note that depending on regional settings you might need to replace semicolon (;) with comma (,)
Also hh:mm:ss is used for hours:minutes:seconds format so you might want to play with that too.
Aug 12 '08 #4

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

Similar topics

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: Hans [DiaGraphIT] | last post by:
Hi! I have a logical problem. How can I convert 2 textboxvalues,(one for hours and one for minutes) to a common value type of float or double. I wish to save this new value in a database ...
19
by: Ricardo Perez Lopez | last post by:
Hello everyone: I'm a PostgreSQL newbie, working now with dates, times, timestamps and intervals. I have three questions about the above: FIRST: --------
6
by: Harlin Seritt | last post by:
I would like to take milliseconds and convert it to a more human-readable format like: 4 days 20 hours 10 minutes 35 seconds Is there something in the time module that can do this? I havent...
2
by: Harlin Seritt | last post by:
How can I take a time given in milliseconds (I am doing this for an uptime script) and convert it to human-friendly time i.e. "4 days, 2 hours, 25 minutes, 10 seonds."? Is there a function from the...
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: 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...
4
realin
by: realin | last post by:
hi guys.. I have made a function which counts the numbers of days or hours or minutes from the current datetime to the give datetime.. but i am confused while displaying number of days along with...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.