on 02-24-2015 3:01 PM
Hi to all,
How to convert NVARCHAR to DATE data type in calculation view.
Example: I have 2 date filed in calculation view with type NVARCHAR, and need to calculate difference between field1 and field2, so
I have created calculated column with expression daysbetween(field1,field2), but it gives error while viewing data.
So we need to convert field1,field2 from NVARCHAR to DATE FIELD.
HOW TO DO THAT ?
Regards
Pavneet Rana
Hi Pavneet,
Please try this :
SELECT DAYS_BETWEEN (TO_DATE(START_DATE), TO_DATE(END_DATE)) FROM DUMMY;
or add this in your calculated column
DAYS_BETWEEN (TO_DATE(START_DATE), TO_DATE(END_DATE))
Note : Assuming START_DATE and END_DATE will be your fields in NVARCHAR
Regards,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pavneet,
Use daysbetween(date(field1),date(field2))
Regards,
Safiyu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pavneet,
You can use the conversion function date() first, please have a look at
Conversion Functions - SAP HANA Modeling Guide - SAP Library
Best regards,
Wenjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.