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

Problem with calculations...........

Hi all,

I've been trying to add the following values in a form, but I don't
know how to do it:

Start Stop WorkedHours SET UET Other Time TotalHours
08:00PM 04:00PM 8:00 05:00 08:00

The DataType of these fields are:
Start: Date/time
Stop: Date/time
WorkedHours: TEXT
SET,UET,OtherTime,TotalHours: TEXT
The problem is that when the employee enter, for instance, in the SET
field: 05:00. I want this field to add up to Totalhours,the same thing
with UET,Other Time..
I tried to change the datatype of these fields to Date/Time, but
when I choose the input mask 00:00, I end up having 00:00AM, and I
don't really want that. The start and stop, works fine...
I've been working on this for a very long time, and I haven't be able
to find out the function..here is the Function that I am currently
using for Start and Stop fields.

Dim Intintervalminutes As Integer
Intintervalminutes = DateDiff("n", Me.Start, Me.Stop)
Me.totalHours = Intintervalminutes \ 60 & Format(Intintervalminutes
Mod 60, "\:00")
Me.TotalHours = Me.WorkedHours
Me.WorkedHours = Me.TotalHours
Thanks in advanced..
Nov 12 '05 #1
2 1158
I work with dates and times a lot and I found that I always have trouble if
I use date functions.

The first thing I would do is to convert them to standard long integers and
then it is just a matter of + or -.....

In the end you then display/format the date/time as the desired date/time
again...

in most cases that works much easier.

Let me know how you get on
"christian" <cs********@partners.org> wrote in message
news:e1**************************@posting.google.c om...
Hi all,

I've been trying to add the following values in a form, but I don't
know how to do it:

Start Stop WorkedHours SET UET Other Time TotalHours
08:00PM 04:00PM 8:00 05:00 08:00

The DataType of these fields are:
Start: Date/time
Stop: Date/time
WorkedHours: TEXT
SET,UET,OtherTime,TotalHours: TEXT
The problem is that when the employee enter, for instance, in the SET
field: 05:00. I want this field to add up to Totalhours,the same thing
with UET,Other Time..
I tried to change the datatype of these fields to Date/Time, but
when I choose the input mask 00:00, I end up having 00:00AM, and I
don't really want that. The start and stop, works fine...
I've been working on this for a very long time, and I haven't be able
to find out the function..here is the Function that I am currently
using for Start and Stop fields.

Dim Intintervalminutes As Integer
Intintervalminutes = DateDiff("n", Me.Start, Me.Stop)
Me.totalHours = Intintervalminutes \ 60 & Format(Intintervalminutes
Mod 60, "\:00")
Me.TotalHours = Me.WorkedHours
Me.WorkedHours = Me.TotalHours
Thanks in advanced..

---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
Nov 12 '05 #2
Hi WindAndWaves..

so you suggest to change those fields to Date/Time and then have as an
input mask Long integer.. But I don't know how to write the funtion??
Can you pleaser help me with that?

Thank you.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

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

Similar topics

3
by: Ufit | last post by:
I must precisely measure the time of calculation. f.ex clock_t begin,finish,time; begin=clock(); Calculations(); finish=clock(); time=finish-begin; but unfortunatelly finish is equal to...
3
by: Caesar Augustus | last post by:
Hello Tom, Long time listener, first time caller... I have been working with vb code to automate a salary increase process that not only rounds to the nearest penny but also rounds to the...
11
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together...
7
by: Hiten | last post by:
Hi please check ffollowing conditon variable float1 and float2 holds user entered value..... Answer=float1 * float2; //output must be 8.5 output must to be 8.5 but it has 8.500002, i am...
9
by: BK | last post by:
In VB.Net (1.1 framework), I have a datagrid that displays records from a SQL table. Only some of the columns are editable. When the user changes data in 2 and only 2 of the columns, I want to...
11
by: Martin Joergensen | last post by:
Hi, I've encountered a really, *really*, REALLY strange error :-) I have a for-loop and after 8 runs I get strange results...... I mean: A really strange result.... I'm calculating...
2
by: DeanL | last post by:
Hi all, I have a problem that I'm a little stumped by and need some help if possible. I need to generate a report in Access 97 from 2 tables (easy so far) but it requires a calculated date...
35
by: bala.pandu | last post by:
Hello Everyone, When i am assigning a float value and try to print the same, i found the value stored is not the exact value which i gave. int main() { float f1; printf("Enter a float value...
7
by: bummerland | last post by:
Hi, I have a problem with the function fmod. Why is fmod(5.7, 0.1) = 0.1 ?? Why is it not 0? tia bummerland
1
by: JeffP | last post by:
Have a textbox in a report footer that sums data using Sum. That text box value is used in a few calculations in the footer. Trouble is, if the report has no data then the box simply shows #error...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.