473,387 Members | 1,603 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.

Subtract times in text

547 512MB
I use this timing application.
A client asked me to add a feature. The athletes run without watches and before the race each one has to give an estimated or expected time they would finish the race. The one with the closest to the actual time wins.
I subtract the finishtime from the starttime to get actual racingtime. Then i subtract the Expected time from this actual racingtime.
It must then be sorted to the one closest to the actual time.
Calculating the difference between the finish and starttimes is easy, but the last part is giving me grey hairs.
The code used to calculate the actual racingtime in query
Expand|Select|Wrap|Line Numbers
  1. RacingTime: Format([TimeFinish]-[TimeStart],"hh:nn:ss")
i think the problem is because the (estimated) expected time is captured in a text field.
i tried this in query
Expand|Select|Wrap|Line Numbers
  1. TimeDiffs: Format$(IIf(IsNull([Racingtime]-[ExpectTime]),0,CDate([Racingtime]-[ExpectTime])),"hh:nn:ss")
i attach an example of this. Go to view results button please.
i will appreciate help
Attached Files
File Type: zip RaceExpectedTime.zip (74.5 KB, 54 views)
Mar 20 '11 #1
2 1848
ADezii
8,834 Expert 8TB
Give the following Statement a Test Run:
Expand|Select|Wrap|Line Numbers
  1. TimeDiff: Format(([TimeFinish]-[TimeStart]) - CDate([ExpectTime]),"h:nn:ss")
Mar 20 '11 #2
neelsfer
547 512MB
Mr Adezi, what can i say? - it works 100% as usual. Thx
Mar 20 '11 #3

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

Similar topics

3
by: Tim | last post by:
I need to get the number of seconds when subtracting two date/times. With the code I am using below I subtract the two date/times and end up with a total of days like "1.56". Then when I multiply...
3
by: Russ Green | last post by:
I'm trying to perform several manipulations to time values (all will be stored in a access database). I need to find the elapsed time between a start time and a finish time and I also need to be...
2
by: Asad | last post by:
Hello, I need to know how I can calculate the number of seconds between two time stamps, e.g. if I have the following (using ToLongTimeString) 8:28:21 PM and 9:02:33 PM
3
by: ACaunter | last post by:
Hi all, I needed to know if there was a way to count the hours a user has been logged on for. When they first log in, i record the time and when the logoff i record the time, but now how would i...
6
by: James Goodman | last post by:
I have modified the ASP.NET TimeTracker Starter Kit to include the ability for users to log working hours (Start Time, Finish Time, Lunch Duration). This is then presented to them in a grid & a...
5
by: Sandy | last post by:
Hello I need to subtract a pm time from an am time, e.g. 10:00 a.m. from 1:00 p.m. to get 3 I have two textboxes for the time values and next to each is a dropdownlist to click indicating a.m....
5
by: cvisal | last post by:
Hi all Im working on productivity calculations (Time calculations) and need some help in coding. Database Tool:MS-Access 2003. The general operator punch-in time is 5:30 AM and the punch-out...
4
by: Gabe Matteson | last post by:
I want to be able to find out the names of files that have not been accessed in the past X days... i allow the user to put in the number of days, e.g. show all files that have no been accessed...
4
bilibytes
by: bilibytes | last post by:
Hi all! i am trying to figure how to subtract some string which is between two other strings: i have: for(lots of times){ some unuseful text and tags... <aloha some=text...
1
by: dougancil | last post by:
I have two text boxes starttimeInput and endtimeInput that have regularexpression validators to only accept input of time variables (11:00 am, 12:15 pm, etc) and then a durationLabel where I want to...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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:
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
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.