on 11-10-2015 9:09 AM
Hello Gurus,
I need some help on below issue in HANA modeler-
I have date in 2015-10-09 stored in table. I want to convert to YYYYMMDD format in table. The date is stored as sql type "'nvarchar" 10 string.
Please suggest the best approach. this is one time activity.
Thanks
Pallavi
Hi Pallavi,
Since the data in the table is of NVARCHAR datatype, the TO_CHAR function would fail.
It issue can be resolved in the below following way:
create table date_test(col1 nvarchar(10));
insert into date_test values('2015-10-09');
select to_char(to_date(col1, 'YYYY-MM-DD'), 'YYYYMMDD')
from date_test;
You need to use to_char(to_date(col1, 'YYYY-MM-DD'), 'YYYYMMDD')
Regards,
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pallavi,
Use TO_CHAR(DATE,8)
select to_char(date,8) from "schema_name"."Table_name" ;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.