Alpha Video Training
Results 1 to 8 of 8

Thread: Character type to Time type

  1. #1
    "Certified" Alphaholic
    Real Name
    jim chapman
    Join Date
    Apr 2000
    Posts
    1,779

    Default Character type to Time type

    Hello,

    We can't store a time value in a table field. I'm wondering if anyone knows if we can convert a character value to a time type value. I want to do a simple elapsed time calculation, but it will extend over days. It would be simple if I could subtract two time values, but I can't store the beginning time value except as a character value. I know I can do it with a little more complex calculation dealing with days and toseconds() etc. but just wondering if anyone has found this possible.

    Thanks,
    Jim

  2. #2
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,279

    Default RE: Character type to Time type

    scantime()

  3. #3
    "Certified" Alphaholic
    Real Name
    jim chapman
    Join Date
    Apr 2000
    Posts
    1,779

    Default RE: Character type to Time type

    Thank you Selwyn,

    I'm struggling to figure this function out. In the interactive window:

    ?now()
    =12/30/2002 08:09:06 40 pm

    ?scantime("12/30/2002 08:09:06 40 pm","1/")
    = 00/00/0000 12:00:01 20 am

    How can I use this function to take a character value, like now() returns, but quoted, and feed this to scantime() to return a time value?

    Thanks,
    Jim

  4. #4
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,279

    Default RE: Character type to Time type

    your format string for the scantime() function is wrong.

    see the ref manual for details.

    or type time( in the interactive window, and then use the genie that pops up to write the format string.

  5. #5
    "Certified" Alphaholic
    Real Name
    jim chapman
    Join Date
    Apr 2000
    Posts
    1,779

    Default RE: Character type to Time type

    Sorry about that Selwyn,

    I searched the manuals for "scantime()" and didn't get a hit, so I thought it was undocumented. Needed to search for "scantime".

    Thanks,
    Jim

  6. #6
    David Day
    Guest

    Default RE: Character type to Time type

    Its on page 85 in the funtions reference manual.

  7. #7
    David Day
    Guest

    Default RE: Character type to Time type

    thats 98...I didnt proofread...lol...sorry

  8. #8
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,279

    Default RE: Character type to Time type

    ?scantime("12/30/2002 08:09:06 40 pm","MM/dd/yy 0h:0m:0s 2 am")

    = 12/30/2002 08:09:06 40 pm

Similar Threads

  1. Edward: How A5 handles TYPE ... END TYPE
    By Marcel Kollenaar in forum Alpha Five Version 5
    Replies: 0
    Last Post: 07-16-2004, 02:46 PM
  2. Get date from Time variable type
    By CALocklin in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-08-2003, 04:06 AM
  3. Find as you type box
    By George Corder in forum Alpha Five Version 5
    Replies: 3
    Last Post: 09-18-2003, 12:47 PM
  4. subelement is of different type
    By Lloyd Frank in forum Alpha Five Version 4
    Replies: 5
    Last Post: 01-02-2002, 04:32 PM
  5. V4.5 file type
    By Rodney Efird in forum Alpha Five Version 4
    Replies: 0
    Last Post: 01-31-2001, 05:15 PM

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
  •