Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 12th, 2005, 11:40 PM
christian
Guest
 
Posts: n/a
Default 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..
  #2  
Old November 12th, 2005, 11:42 PM
WindAndWaves
Guest
 
Posts: n/a
Default Re: Problem with calculations...........

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" <csepulveda@partners.org> wrote in message
news:e1cc3cc3.0405100528.63f80906@posting.google.c om...[color=blue]
> 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..[/color]


---
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


  #3  
Old November 12th, 2005, 11:42 PM
cristian sepulveda
Guest
 
Posts: n/a
Default Re: Problem with calculations...........

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!
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles