DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Date Format

  1. #1
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598

    Question Date Format

    Hi,
    Input date format: 'CCYY-MM-DD'
    Input date : '2102-11'

    Expected Results in YYYYMM format: 200211

    How to get the results in the above format using simple SQL comand.

    Cheers!
    Cheers!
    OraKid.

  2. #2
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588
    Code:
    SQL> select to_char(to_date(substr('&datum',3),'YY-MM'),'YYYYMM') datum from dual;
    Enter value for datum: 2102-11
    old   1: select to_char(to_date(substr('&datum',3),'YY-MM'),'YYYYMM') datum from dual
    new   1: select to_char(to_date(substr('2102-11',3),'YY-MM'),'YYYYMM') datum from dual
    
    DATUM
    ------
    200211
    
    SQL>

  3. #3
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598

    Thumbs up

    Thnx Sameer
    Cheers!
    Cheers!
    OraKid.

Posting Permissions

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


Click Here to Expand Forum to Full Width