473,569 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subtracting Time

I have a table that contains the following fields:

ItemName // Name of Assignment
AvgTime //Estimated number of mins to complete

I have a form that has a combo box listing all assignments (Record
Source: ItemName)
This form also contains three textboxes [Hours] and [Mins] and
[NumberOfComplet ions]

When the user updates the [NumberOfComplet ions] field I have the
[Hours] and [Mins] Textboxes calculate the time it took based on the
AvgTime.

Example [NumberOfComplet ions] * [AvgTime] = [Mins] ; 2 Completions * 15
AvgTime = 30 mins...

Not too complex.

I have it calculating the hours with the following code:

Me.Mins = Me.AvgTime * Me.NumberOfComp letions
If Me.Mins 59 Then
Me.Mins = Me.Mins - 60
Me.Hours = Me.Hours + 1
Else
End If

This works great if I do increments by "1". However, sometimes I may
want to put in 45 completions. Obviously incrementing the "Me.Hours+1 "
would not work anymore.

Are there any special functions or commands that would do the division
and give me the integer part and then calculate the mins based on the
remainder?

Any suggestions would be greatly appreciated!

Thank you!

Brad

Jul 6 '06 #1
1 2051

I FIGURED THIS OUT. PLEASE DISREGARD!
Drum2001 wrote:
I have a table that contains the following fields:

ItemName // Name of Assignment
AvgTime //Estimated number of mins to complete

I have a form that has a combo box listing all assignments (Record
Source: ItemName)
This form also contains three textboxes [Hours] and [Mins] and
[NumberOfComplet ions]

When the user updates the [NumberOfComplet ions] field I have the
[Hours] and [Mins] Textboxes calculate the time it took based on the
AvgTime.

Example [NumberOfComplet ions] * [AvgTime] = [Mins] ; 2 Completions * 15
AvgTime = 30 mins...

Not too complex.

I have it calculating the hours with the following code:

Me.Mins = Me.AvgTime * Me.NumberOfComp letions
If Me.Mins 59 Then
Me.Mins = Me.Mins - 60
Me.Hours = Me.Hours + 1
Else
End If

This works great if I do increments by "1". However, sometimes I may
want to put in 45 completions. Obviously incrementing the "Me.Hours+1 "
would not work anymore.

Are there any special functions or commands that would do the division
and give me the integer part and then calculate the mins based on the
remainder?

Any suggestions would be greatly appreciated!

Thank you!

Brad
Jul 6 '06 #2

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

Similar topics

1
82740
by: Jesse O | last post by:
I have two date fields, start_date and end_date. I'd like to subtract the two dates, and come up with a number (the number of difference between the two dates). What function is there to do this? I haven't been able to find anything in BOL.
8
5786
by: simpleman | last post by:
Hi, I have an assignment that requires me to subtract two very large unsigned integers using linked list.AFAIK I have to manipulate data as character. But I dont know how to get input into the linked list since the input will all be in one line. eg. 1234567890. Also I have to use one integer per node. Any help/suggestion will be greatly...
4
6130
by: Robert Schoenert | last post by:
I want to be able to subtract two time fields, one starting before midnight and the other past midnight. example: starttime 23:00 and endtime 01:10 The answer is 1:10. How can I do this with all times on the 24 hour clock?
11
6452
by: Laery | last post by:
Hi, I'm currently adding a new module to an old borland C3.1 application (dos). And I need to calculate a date by subtracting the number of days from a given date. I know I could use an array of days in the months and go back by leaping when 1 is reached. (keeping the 29the of feb and january/year in mind).
31
10290
by: Spiro Trikaliotis | last post by:
Hello, I have a question regarding subtracting a pointer from another one. Assume I have two pointers p1 and p2, which both point to a memory area obtained with malloc(). Assume p1 = p2 + some value c. Now, I want to obtain the difference between the two, that is, the value c. Which type must I use for c? I searched around and did not...
3
2448
by: Martin Joergensen | last post by:
Hi, Just a small problem (about taken the previous unsigned value in a 1D- array and copying it to the current value). Suppose there's an outer loop over the line shown below, so unsigned_int_ptr keeps changing, as it is a parameter in the function called function( &array ).... void function( unsigned *unsigned_int_ptr)
2
8760
by: Paulers | last post by:
hello all, how does one go about subtracting seconds from a DateTime object? for example I have a date time of "06/04/2007 10:31" and I need to subtract 12 seconds from that. all help is greatly appreciated.
1
7394
by: electroon | last post by:
Hi frnds, I have written a code to get current time struct tm *locTime; time_t currentTime; time( &currentTime ); locTime = localtime(&currentTime ); Suppose now i get output time as 31-DEC-2007 00:00:00
1
2088
by: chemz | last post by:
hi all, i have problem in creating a formula of my code. this is all about updating a mysql database in including it in php. I dont know how to generate it. can you please give me some code in a working php with mysql. This code is to update after clicking the word update and to subtract each time to click by once.. Please help me.. ...
11
5664
by: fred.l.kleinschmidt | last post by:
If one knows that x and y are unsigned integers (of unknown size - they may be short, int, long, long long), what is the most portable way to determine their difference? If x is smaller than y, then x-y is negative. A naive approach is if ( x y ) { ... }
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.