Quantcast
Channel: SCN : Unanswered Discussions - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 4343

HANA Date and Time Comparison

$
0
0

Dear All,

 

I would like ask for your help regarding Date conversion in HANA.

 

In my view i have two columns: DueDate (NVARCHAR(8) and DueTime (NVARCAR(6)). These columns have values like this:

DueDate = '20140213'

DueTime = '092345'

 

I need to decide if an item is overdue. The calculated value should be 'X' or ''.

I tried to create a Calculated Column with a conversion like these:

 

1.) This seemed the simplest way, but i got a syntax error.

 

if(date("DueDate")<now() OR (date("DueDate")=now() AND time("DueTime")<(utcnow()),'X','')

 

2.) This is more complex with more conversions. I don't get any syntax error, only when i try to display the preview.

 

if(date("DueDate")<date(string(now())) OR (date("DueDate")=date(string(now())) AND time(string("DueTime"))<time(string(utcnow()))),'X','')

 

Where is the problem? What am i doing wrong?

 

Thanks for you help.

 

Regards,

Gergo


Viewing all articles
Browse latest Browse all 4343

Trending Articles



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