3 Replies Latest reply: Jan 25, 2012 9:02 AM by Stefan Wühl RSS

    Values for last date

      Hi all,
      I am trying to select some totals, but only for yesterday.
      However my formula doesn't work (and I realise that the first two values are redundant.
      Please help! Thanks in advance,
      Wouter
      sum
      ({$<
      JAAR = {$(vYear) },
      Periodenummer = {$(vPeriod) },
      DATUM =  {$(Date(vYesterday)) }
      >}
      AANTAL)
      My yesterday variabele is set by this line:
      LET
      vYesterday = Num(Now())-1;
        • Re: Values for last date
          Stefan Wühl

          Wouter,

           

          Now() will return a Timestamp with decimal places, while I assume your DATUM values are integer values in numerical representation. Consider using Today() instead.

           

          Then, do the Date formatting also in your variable definition:

          LET vYesterday = Date(Today(1)-1);

           

          Thus your DATUM set element modifier looks like

          DATUM =  {$(vYesterday) }

            • Values for last date

              Hi Swuehl,

              thank you, I didn't know the difference between Now() and Today().

              I have changed the formula's, but without success.   Any other ideas?

                • Values for last date
                  Stefan Wühl

                  First check, that your DATUM values are integer values, too, e.g. by creating a list box with field DATUM and an additional expression num(DATUM). Should only show integer values like 40933.

                   

                  Then check that your DATUM field values use also the standard date format, which is used in formatting Date(today(1)).

                   

                  Check that your DATUM field has a value for today..

                   

                  Lastly, try enclosing your variable values in single quotes:

                  DATUM =  {'$(vYesterday) '}