473,466 Members | 1,363 Online
Bytes | Software Development & Data Engineering Community
Create 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
[NumberOfCompletions]

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

Example [NumberOfCompletions] * [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.NumberOfCompletions
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 2047

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
[NumberOfCompletions]

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

Example [NumberOfCompletions] * [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.NumberOfCompletions
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
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...
8
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...
4
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...
11
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...
31
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...
3
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...
2
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...
1
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...
1
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...
11
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,...
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
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
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...
1
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.