title: How to print DateTime variable in the RAISERROR method?
body: <p>My Stored Procedure accepts two params
   @EffectiveStartDate DATETIME<br>
   @EffectiveEndDate DATETIME</p>
  
  <p>I wrote the validation code as this:</p>
  
  <pre><code>IF(@EffectiveStartDate &gt; @EffectiveEndDate)
          BEGIN
              RAISERROR ('SPName: InsertUpdateLiquidityDateRule:  Start Date: %s cannot  be greater than End Date %s',11,1,CAST(@EffectiveStartDate AS varchar(30)),CAST(@EffectiveEndDate AS varchar(30)));
              RETURN -1
          END 
  </code></pre>
  
  <p>May I know what am I doing wrong here. </p>
  
  <p>While Compiling my SProc, it raised the message 'Incorrect syntax near CAST()'</p>