Skip to Content
0

How to realize SQL's function TO_NVARCHAR with Column Engine's functions?

Feb 14, 2017 at 08:43 AM

68

avatar image

In HANA STUDIO, I used SQL function TO_NVARCHAR(''BLDAT'','YYYY/MM/DD') in Calculated Columns to convert the YYYYMMDD date in BLDAT into YYYY/MM/DD and made it.

But according to project's request, this conversion should be realized with Column Engine, not SQL. Please answer this question, if you have some good ideas, Thank u so much.

link for functions which can be used with Column Engine.

Using Functions in Expressions

http://help.sap.com/saphelp_hanaplatform/helpdata/en/d7/70825bbb5710148ca7cd47cb086923/content.htm?frameset=/en/f5/a9ca3718354a499a98ba61ae3da170/frameset.htm¤t_toc=/en/27/c84904d7df4573a7a4dadf270a20a0/plain.htm&node_id=177&show_children=false

SQL
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Florian Pfeffer
Feb 14, 2017 at 09:46 AM
1

You can use a combination of the DATE and FORMAT function. The DATE function to convert the BLDAT date string to a date which then can be used by the FORMAT function to create a NVARCHAR typed result in your format.

The expression for the column engine calculated column looks like following:

format(date("BLDAT"),'YYYY/MM/DD')

Regards,
Florian

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks a lot ! this is a definately correct answer.

I also figured out this combined function yesterday and expected value came out.

Thank u again!

0