Skip to Content
avatar image
Former Member

DAYSBETWEEN Input Parameters

Hi.

I have created 2 input parameters as type date for the start and end dates. I want to create a calculated column to calculate the days between the dates selected. I have done it on 2 separate ways but get different errors on both.

1st method: daysbetween('$$p_StartDate$$', '$$p_EndDate$$') goves error that my parameters are of type string, which it is not.

2nd method: daysbetween(daydate('$$p_StartDate$$'), daydate('$$p_EndDate$$')) - gives a Column Store error 6931 attribute is not a date or syntax error.

Could you please advice what I am doing wrong, we are on HANA rev 91.

Thanks.

Koos.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 19, 2015 at 09:30 PM

    Hi Koos,

    Try using the below syntax.

    daysbetween(date($$start_date$$),date($$end_date$$))/365

    Regards,

    Venkat N.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Dubravko.

      I am doing exactly the same with different outcome.

      My Parameters:

      and calculation check

      and then I saw that when I double click on the parameter to add it to formula it puts a single quotation mark in front and back. So as soon as I remove it the formula is working.

      I do not understand why but thanks it is working.

      Param1.jpg (52.8 kB)
      Param2.jpg (55.1 kB)
      calc.jpg (99.2 kB)
  • avatar image
    Former Member
    May 19, 2015 at 02:15 PM

    Try $$p_EndDate$$ - $$p_StartDate$$

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Dubravko.

      No, it says that the parameter is a string and you cannot use the minus sign. I also tried to convert it to a date but then it give the second error again that it is not a date or a syntax error.