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!
Printable View
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!
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>
Thnx Sameer
Cheers!