cancel
Showing results for 
Search instead for 
Did you mean: 

How to get current date as SECONDATE in HANA Calculated Column

0 Kudos

I'm building a HANA calculation view and in one of the column I need to get current date in a SECONDDATE Format. Like if today is 26.01.2021 I need to get 26.01.2021 00.00.00.0.

I try following, but event I don't get any errors and validation is ok, I dont get any data retrieved:

By the way my CurrentDateTimeCET looks following:

What do I do wrong?

Thanks for your help in advance!

BR.

pfefferf
Active Contributor
0 Kudos

Do you get no records at all, or just no value in the that calculated column? If you get no records then of course you will not get a value for that column too.

Accepted Solutions (1)

Accepted Solutions (1)

Jörg_Brandeis
Contributor

Hi Denis,

a few recommendations from my side:

  • Set Language to SQL
  • Use the SQL-Function TO_SECONDDATE
  • Test expressions in the SQL-Console with a SELECT FROM DUMMY:
SELECT to_seconddate(current_utcdate) FROM DUMMY

You can find some more useful tips and the most relevant SQL-Functions in this SAP HANA SQLScript Overview.

With best regards,
Jörg

Thank you for your tipp, Jörg! My logic works now.

Answers (0)