[AccessD] Best Practices: Recording Hours and Minutes

Mark A Matte markamatte at hotmail.com
Thu Jan 18 12:44:38 CST 2007


Larry,

I don't know if it is best practice...but I have a number of dbs with 'time 
tracking' functionality.  I either store the start time and end time...and 
then calculate the difference...or I store the smallest increment I need and 
then calculate from there.  For example...I needed to display minutes and 
seconds...so I stored seconds and used the following to convert to display 
minutes and seconds:

Seconds = DateDiff("s", Me!StartDTTM, Me!EndDTTM)
Dim Check, Counter
Check = True: Counter = 0

Do
    Counter = Counter + 1
    If Counter * 60 > Seconds Then
        RMmin = Counter - 1
        RMsec = Seconds - ((Counter - 1) * 60)
        Check = False
        Exit Do
    End If
Loop Until Check = False

Again, not sure if it is best practice...but works for me.

Good Luck,

Mark A. Matte


>From: "Lawrence Mrazek" <lmrazek at lcm-res.com>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: "'Access Developers discussion and problem 
>solving'"<accessd at databaseadvisors.com>
>Subject: [AccessD] Best Practices: Recording Hours and Minutes
>Date: Thu, 18 Jan 2007 11:36:05 -0600
>
>Hi:
>
>I'm trying to figure out the best ways to record hours and minutes
>(application tracks downtime of various equipment and time spent on
>maintenance), and am wondering how others do this.
>
>I'm currently using a decimal field to record the hours and minutes (EX:
>1.25 is 1 hour, 15 minutes), but am wondering if I should do this
>differently as far as data entry and storage.
>
>Thanks in advance.
>
>Larry Mrazek
>LCM Research, Inc.
>www.lcm-res.com
>lmrazek at lcm-res.com
>ph. 314-432-5886
>mobile: 314-496-1645
>
>
>--
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com

_________________________________________________________________
Laugh, share and connect with Windows Live Messenger 
http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=hmtagline




More information about the AccessD mailing list