cancel
Showing results for 
Search instead for 
Did you mean: 

can anyone tell how to use daysbetween() function in analytical view?

vikramvikshr
Explorer
0 Kudos

I have been trying to calculate days by using function daysbetween(date1,date2) in anlytical view where I have put date 1 as a column from a table and date 2 as input parameter. However, I am getting syntax error while validating the expression. Sometimes, it also pops with error like " date1 is not an attribute".

Could you please confirm if I am going right or missing somethng?

Regards,

Vikram Sharma

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member187673
Active Participant
0 Kudos

Hi Vikram, need to make sure the params are date type. I used something like this before :

daysbetween(date("ERDAT"), now())

where ERDAT is column of type NVARCHAR(8)

Peter

vikramvikshr
Explorer
0 Kudos

Hi Peter,

The datatype is date, initially it was NVARCHAR type but i wanna keep it to date type so i changed it.

However, the query that you have given will calculate days from current date, right?. I have one date as a column in a table and another date is from input parameter.

So I need to calculate days lapse between two specified dates in which i have been unsuccessfull so far..

Also, just for your info. when i used this date function in HANA SPS 07 it was working fine but don't know what happen now when I am using it in SPS08.

Regards,

Vikram

former_member187673
Active Participant
0 Kudos


This comment is interesting: "Also, just for your info. when i used this date function in HANA SPS 07 it was working fine but don't know what happen now when I am using it in SPS08."

We're currently on SPS07 which works fine. You may want to log an incident with SAP support for this if your code was working on a previous version.

Peter

vikramvikshr
Explorer
0 Kudos

..seems now, I have to log an incident for this.

Anyways, thanks Peter for your help.