13 Replies Latest reply: Jul 1, 2013 12:11 PM by sarah_mader RSS

    Count({<Date={'<=$currentDate)'}>}Date) doesn't return correct number?!

      Hallo!

       

      I'm running in some issue while using the count-function.

       

      Like header shows i want to count dates, wich are smaller(before) the currentDate.

      CurrentDate is a variable and changes.

       

      But the function always returns the wrong(for me, maybe function is working correct) number...

      If i have this table:

       

      SerialDatePrice
      12301-01-20135
      23402-02-20136
      34502-02-20137
      12304-05-20138

       

      and use function:

       

      count({<Date={'<=$(currentDate)'}>}Date)

       

      i would expect following result:

       

       

      currentDatecount({<Date={'$(currentDate)'}>}Date)
      01-01-20131
      ...1
      02-02-20133
      ...3
      03-03-20133
      ...3
      04-05-20134

       

      But its not:(

      If i check using FieldValue('Date',count({<Date={'<=$(currentDate)'}>}Date)) it returns wrong date.

      It's much more in future, means the count-function returns a too big value...

       

      Example:

      currentDate = 23-01-2013

      count({<Date={'<=$(currentDate)'}>}Date)=3

      FieldValue('Date',count({<Date={'<=$(currentDate)'}>}Date))=03-03-2013                    (not always 2 days later, i didnt find an order)

       

      Seems like i do not understand how the function works^^

      What is wrong?

       

      Thanks for reading,

       

      Sarah

       

      'Count({<Date={'$currentDate)'}>}Date)'  adjusted to 'Count({<Date={'<=$currentDate)'}>}Date)', after friendly hint from Joerg Hildebrandt