Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Location
    Waukesha WI
    Posts
    78

    Unanswered: SQL Loader:2 digit year handling

    I have a date field that has six characters that I wish to place in a table and have it assume the century to be "20".
    I typically do:
    MYDATE POSITION(158:165) DATE "YYYYMMDD" NULLIF MYDATE='00000000'

    Can it be done?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    PHP Code:
    MYDATE POSITION(158:165DATE "YYMMDD" NULLIF MYDATE='000000' 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    close,

    MYDATE POSITION(158:165) DATE "RRMMDD" NULLIF MYDATE='000000'
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    mine won't work?
    PHP Code:
    Table TEST1loaded from every logical record.
    Insert option in effect for this tableAPPEND
    TRAILING NULLCOLS option in effect

       Column Name                  Position   Len  Term Encl Datatype
    ------------------------------ ---------- ----- ---- ---- ---------------------
    THE_DATE                            FIRST     *   ,       DATE yymmdd          

    value used 
    for ROWS parameter changed from 5000 to 992

    Table TEST1
    :
      
    1 Row successfully loaded.
      
    0 Rows not loaded due to data errors.
      
    0 Rows not loaded because all WHEN clauses were failed.
      
    0 Rows not loaded because all fields were null.


    sqlselect from test1;

    THE_DATE
    --------------
    12312004 00:00 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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