Alpha Video Training
Results 1 to 2 of 2

Thread: Capturing the first two positions of a field

  1. #1
    Member
    Real Name
    Steve Coronado
    Join Date
    Jun 2008
    Posts
    1

    Default Capturing the first two positions of a field

    Hello. Attempting to capture the first two positions of a field from an incoming record. The field contains a date in the form of mm/dd/yyyy. I want to capture the “mm” portion of the field and move it to a variable. I am unable to determine how to do this. Any help would be appreciated. Thank you! Steve.

  2. #2
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Capturing the first two positions of a field

    Hi Steve and welcome to Alpha!

    This should get you started...there are several ways to do this. Using the Interactive Editor I came up with one.
    Code:
     
    dim cDt as c
    cDt=dtoc({05/11/2008})
    ?cDt
    = "05/11/2008"
    ?word(cDt,1,"/")
    = "05"
    Simply set the result to whatever character variable you want.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




Similar Threads

  1. Button positions in Lookup window
    By dchiass in forum Alpha Five Version 8
    Replies: 0
    Last Post: 05-09-2007, 08:06 PM
  2. Starting Label Positions
    By Tony Watts in forum Alpha Five Version 5
    Replies: 2
    Last Post: 12-04-2006, 12:13 PM
  3. Capturing Field Value of Most Recent Record
    By Howard G. Cornett in forum Alpha Five Version 5
    Replies: 2
    Last Post: 04-22-2003, 12:56 AM
  4. Form Positions
    By Ewan McAllister in forum Alpha Five Version 5
    Replies: 5
    Last Post: 11-14-2002, 08:07 PM
  5. Indexes swap positions, W98ME
    By Maurice Mercado in forum Alpha Four Version 6 and Prior
    Replies: 5
    Last Post: 06-07-2001, 12:49 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
  •