Alpha Video Training
Results 1 to 5 of 5

Thread: Yet another Date question

  1. #1
    Member
    Real Name
    Joe Sepanek
    Join Date
    Oct 2005
    Location
    Louisville, KY
    Posts
    4

    Default Yet another Date question

    I am new to Alpha, but have worked in the business basic world (ProvideX, Basis, etc) for 20+ years. I have some ISAM files that I want to import into a table. I created the table, which includes a multikey index and created a tab delimited text file from my legacy data. So far, so good. One of the fields in the key is a date in the form YYYYMMDD. I use that form all the time in sort keys. Alpha doesn't like that format of a Date. When I do an import, with my table element set as DATE, Alpha just strips it out and the table has no dates! What does Alpha want in terms of a date? Do I have to make the element into a Character and then play with the formatting? In fact, I have done just that. Only problem now is that in the form that I created to display the records, I have no clue as to how to simply format the date. I have been all over the Help File and have read a ton of posts here relating to date issues, but my questions don't seem to be answered anywhere.. at least not within the last 3-4 months that I searched in. I know you old time db programmers are probably laughing your butts off, but I've wasted a ton of time on something that should be elementary. Do you have to enter in code somewhere to pull this off? How do you tell Alpha that YYYYMMDD is a valid Date format? I did some Access stuff a couple of years ago and didn't have near this much grief. Any help would be greatly appreciated.

    Joe
    Louisville, Kentucky

  2. #2
    "Certified" Alphaholic
    Real Name
    Charlie Crimmel
    Join Date
    Apr 2000
    Location
    West Virginia
    Posts
    1,695

    Default

    Alpha uses a MM/DD/YYYY format

    easiest way might be to have 2 fields

    your information comming into a character defined field. YYYYMMDD

    then a field to hold the converted date

    newdate = ctod(substr(yourfield,5,2)+"/"+substr(yourfield,7,2+"/"+substr(yourfield,1,4)

    charlie Crimmel

  3. #3
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default

    This situation has bothered me before, too. I've just now begun a new topic in the Features Wishlist Forum to propose the addition of a new function to convert YYYYMMDD strings into Dates. -- tom

  4. #4
    Member
    Real Name
    Joe Sepanek
    Join Date
    Oct 2005
    Location
    Louisville, KY
    Posts
    4

    Default

    Thanks Charlie. Good info, but I have no clue where to put what you posted... so I will keep digging in the help files.

    Tom, seriously, if I had known about this date issue, I doubt I would have purchased the product. It is so fundamental that I can't imagine having something that maintains data, yet is ignoring a sortable date field in the table structure. Maybe I'm missing something, but so many people have posted issues with dates when doing importing and even just using the YYYYMMDD format as a DATE field that Alpha seems to have dropped the ball here.

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

    Default

    Quote Originally Posted by golferman53
    .............I doubt I would have purchased the product. It is so fundamental that I can't imagine having something that maintains data, yet is ignoring a sortable date field in the table structure. ...............
    Hello Joe,

    I don't think it is that serious ........... but then I'm an long time alphaHolic. I don't think this is a deal, but certainly other environments may handle this more intuitively, but it is really not problem in Alpha once you get used to how things are done ( IMHO :-). We use cdate to sort all the time, and Alpha uses it internally in indexes etc.. For the most part it is transparent .............. again at least from a long time Alpha users perspective.

    During the import you can use an expression to convert to an DBF date format, or use charlie's suggestion of importing to a character field and then having a calc field that converts the imported string to a DBF date.

    Here is a simple user defined function that you can paste into the function editor and you'll have a function to do this:

    Code:
    FUNCTION cDateToDate AS D (vCdate AS C )
    	cDateToDate = eval("{"+substr(vCdate,5,2)+"/"+substr(vCdate,7,2)+"/"+substr(vCdate,1,4)+"}")
    END FUNCTION
    Good luck and welcome to the Alpha community.

    Jim
    Last edited by Jim Chapman; 11-02-2005 at 11:16 PM.

Similar Threads

  1. Date question: calculate tuesdays in month
    By Shahin Cassim in forum Alpha Five Version 5
    Replies: 11
    Last Post: 07-15-2003, 09:13 AM
  2. Date Calendar Question
    By Marc King - A5solutions in forum Alpha Five Version 5
    Replies: 6
    Last Post: 01-03-2003, 08:45 AM
  3. Date Change Question
    By forskare in forum Alpha Five Version 4
    Replies: 7
    Last Post: 04-05-2002, 07:40 PM
  4. question on DATE
    By ken tjia in forum Alpha Five Version 4
    Replies: 8
    Last Post: 06-10-2000, 07:09 AM
  5. date validation question
    By eeetee in forum Alpha Five Version 4
    Replies: 3
    Last Post: 05-22-2000, 03:01 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
  •