Alpha Video Training
Results 1 to 3 of 3

Thread: Between (times)

  1. #1
    "Certified" Alphaholic
    Real Name
    Russ Boehle
    Join Date
    Mar 2000
    Location
    Connecticut
    Posts
    2,767

    Default Between (times)

    A suggestion from a thread in the v6 board.

    To all:
    What is the easiest way to calculate elaspe time.

    user enters start time as 8:23 AM and enters end time as 12:15 PM

    should calculate to 3 hours and 52 minutes

    I can do this by doing several steps, but is there an easier way.

    Charlie Crimmel

    This seems a perfect example of a function that could be build into A5. This comes up a lot and when it spans days can get confusing.

    Russ

  2. #2
    Member
    Real Name
    Lary White
    Join Date
    Apr 2002
    Location
    Plano, Texas
    Posts
    49

    Default RE: Between (times)

    Russ,

    The attached will work for any 24 hour window of time, which will satisfy most payroll applications.

    'Date Created: 27-Mar-2003 05:08:29 PM
    'Last Updated: 30-Oct-2004 11:34:27 PM
    'Created By :Lary L. White
    'Updated By :Lary L. White

    'Displays Elapsed Time as a formatted time field. Input is a character field(Start) and a character field(Stop)
    'Entered as ClockHours("8:23 AM","12:15 PM") ~ "3:52" or Entered as ClockHours("8:30 PM","12:15 AM") ~ "3:52"

    FUNCTION ClockHours AS C (Start as C,End as C)

    ClockHours=If(toseconds(End)"toseconds(Start),Totime(toseconds(End)-toseconds(Start),1,0),Totime(toseconds("24:00")-toseconds(start)+toseconds(end),1,0))

    END FUNCTION

  3. #3
    "Certified" Alphaholic
    Real Name
    Russ Boehle
    Join Date
    Mar 2000
    Location
    Connecticut
    Posts
    2,767

    Default RE: Between (times)

    Thanks Larry,
    My company's time clock system runs on Alpha 4 so the ability to do this isn't the issue. We have been doing it for quite a few years. The issue is that this comes up from time to time and seems a perfect example of a function that should be built in.

    Russ

Similar Threads

  1. Must Push Buttons 4 Times
    By forskare in forum Alpha Five Version 5
    Replies: 13
    Last Post: 03-27-2003, 02:08 AM
  2. Predicting Query times
    By tlyon in forum Alpha Five Version 4
    Replies: 2
    Last Post: 02-16-2002, 03:50 AM
  3. Append times, reasons, solution?
    By Bill Warner in forum Alpha Five Version 4
    Replies: 9
    Last Post: 05-22-2001, 03:21 PM
  4. Best and Worst of times
    By nick marodis in forum Alpha Five Version 4
    Replies: 6
    Last Post: 01-27-2001, 03:27 AM
  5. Event only works 15 times
    By Gren Brown in forum Alpha Five Version 4
    Replies: 4
    Last Post: 12-20-2000, 01:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •