Quantcast
Channel: SCN : All Content - ABAP for SAP HANA
Viewing all articles
Browse latest Browse all 831

How to convert a timestamp to date/time in CDS View?

$
0
0

Dear experts,

 

I would like to convert a timestamp to a date and time within a CDS view.

This is what I tried to do:

 

Cast (Cast(<timestamp> as abap.dec(8,0)) as abap.dats) as <date>

 

I also thought about first converting the timestamp into a plain numerical character, then using substring and then casting it to abap.dats. Then its giving me an error that says: "dec can't be converted into numc".

 

The above written code also throws an error - "function not allowed/ no cast within a cast".

It is quite nasty not being able to write a cast within a cast - how else am i supposed to achieve a date here?

 

I am looking forward to have your answers!

 

Thanks and BR

Anja


Viewing all articles
Browse latest Browse all 831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>