4 Replies Latest reply: Nov 16, 2013 11:53 AM by Stefan Wühl RSS

    Date not working in where clause

    Steve Zagzebski

      In the script below I can't get the where clause in the "Retention Customer" table to work.

      The variable vRetentionDateProduction = 1/1/2013.

      If I hard code into my where clause:  Where ProdGLMonth <= makedate(2013,01,01) it works fine.  But for some reason it won't intepret the variable (vRetentionDateProduction) accurately. Am I doing something wrong?

      Production_MaxDate:
      LOAD
      Max(Date([ProdGLMonth])) as vRetentionDateProduction
      Resident Production;

       

       

      LET vRetentionDateProduction = Peek('vRetentionDateProduction', 0, 'Production_MaxDate');

      Retention_Customer:
      Load
      sum([Commission]) as [Commission Cube Pre]
      Resident Production
      Where ProdGLMonth <= $(vRetentionDateProduction);

       

      Thanks, Steve