4 Replies Latest reply: Feb 25, 2011 11:11 AM by Aline.Koch RSS

    Issue with yeartodate() timestamp

      Hello,

      I am trying to use the yeartodate() function in the following way:

       

      =Count(if(yeartodate(R_SALE_START_DATE,0,1,REPORT_YTD),R_ACCOUNT_NUMBER))

       

      REPORT_YTD is a distinct value (a date).

       

      My issue is simple, this function should provide me exactly what I need but something is happening with the ref_timestamp (REPORT_YTD). If I remove this ref_timestamp and just let the function default to today's date I get the results I want, but if I include this variable which is a few days earlier than today's date, I get values twice the size.

      As a final test, if I simply write the date (e.g. '2011-02-18') instead of using the field, then I get the correct values!!

      One work around I can see (failing to get help on this issue) is to test the dates, so part 2 of my question is to evaluate dates (i.e. < = <=, >, ) can someone please shed some light on the correct evaluation syntax for date fields?

       

      Thanks

       

      GPC