Alpha Video Training
Results 1 to 8 of 8

Thread: formatting absolute time values from a character field

  1. #1
    Member trackmanpete's Avatar
    Real Name
    Pete Schuder
    Join Date
    Sep 2005
    Location
    Mansfield, MA
    Posts
    592

    Default formatting absolute time values from a character field

    Unlike most of the posts that deal with time differences for the workday, I am interested in doing some math manipulation of a single time figure and formatting the result back into a time mask xx:xx.xx (min:seconds.hundreds).

    Here is my scenario:I have a field where I would like to place a race time of 14:34.04 (14 min, 34 sec and 04 hundreds). I place this performance in a character field. I now want to get the time per mile, assuming this time is for 2 miles (slow runner). I then want to fill in another field (could be a calculated field) that will provide me with a final calculated figure of 7:17.02.

    I know the formula is a bit complicated, since it needs to not only do multiplication and division to convert everything to seconds and then back again, but then also needs to do place holdings to include the "xx:xx.xx" for the min:sec.hundreds for the final viewing (some sort of masking?). Is there an example of this type of formula someplace in the help files or on the board? I did find a formula by goggling, only it was for Visual Basic. I also had this formula for a MAC database, but the language there is proprietary and I have long forgotten how I did it anyway.

    I am thinking that the time functions available here do not apply and one must resort to xbasic. Am I correct on this?

    Thanks for looking...

    Pete Schuder

  2. #2
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: formatting absolute time values from a character field

    ..sure hope you don't have too many questions like this! :)
    Last edited by G Gabriel; 05-11-2007 at 06:16 AM.

  3. #3
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: formatting absolute time values from a character field

    Pete,

    Will this work?

    Code:
    vtrackmiles = 2.0
    vracetime = "14:34.04"
    vsecpermile = toseconds(vracetime)/vtrackmiles
    vmiletime = totime(vsecpermile,2,2)
    ? right(vmiletime,8)
    = "07:17.02"
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  4. #4
    Member trackmanpete's Avatar
    Real Name
    Pete Schuder
    Join Date
    Sep 2005
    Location
    Mansfield, MA
    Posts
    592

    Default Re: formatting absolute time values from a character field

    I appreciate your offer, but there seems to be a file missing, as I can't open your sample.

    Sorry, but I have spent many days looking for an answer without any luck. I am trying hard to learn this stuff. Hey, I even found three bugs for Selwyn...:D

  5. #5
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: formatting absolute time values from a character field

    Pete,
    see if this works for you. Gabriel's is more robust than mine.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  6. #6
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: formatting absolute time values from a character field

    I was only kidding..

  7. #7
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: formatting absolute time values from a character field

    Gabriel,
    This is a much better picture!

    http://popwatch.ew.com/photos/uncate...3__rosie_l.jpg
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  8. #8
    Member trackmanpete's Avatar
    Real Name
    Pete Schuder
    Join Date
    Sep 2005
    Location
    Mansfield, MA
    Posts
    592

    Default Re: formatting absolute time values from a character field

    G and Mike:
    This is great. It would have taken me a month of Sundays to search this concept down, let alone know how to incorporate it properly. I will study it diligently. I really appreciate the help. Both of you are really good.

    Thanks again.

    Pete

Similar Threads

  1. changing character field to time field
    By foodminer in forum Alpha Five Version 8
    Replies: 16
    Last Post: 03-08-2007, 03:16 AM
  2. Inspect Memo or Image field code (absolute selected)?
    By Amanita in forum Alpha Five Version 6
    Replies: 3
    Last Post: 11-30-2005, 01:29 PM
  3. formatting time field
    By Tony Agnone in forum Alpha Five Version 5
    Replies: 11
    Last Post: 08-29-2005, 01:16 PM
  4. Formatting a character date field
    By Frank Lucenti in forum Alpha Five Version 4
    Replies: 4
    Last Post: 05-23-2002, 02:45 PM
  5. Character field format for Time
    By forskare in forum Alpha Five Version 4
    Replies: 3
    Last Post: 10-09-2000, 11:10 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
  •