title: How to pass GETDATE (Only date) as a parameter in sql server?
body: <p>I want to pass the system date (<code>GETDATE</code>) only as a parameter in my SQL stored procedure. But I am getting an error while executing the procedure.</p>
  <p><strong>SQL query:</strong></p>
  <pre><code>  ALTER PROCEDURE ST_PRO_GETUSER
    @D DATETIME = GETDATE  --// passing GETDATE as a parameter.
    AS BEGIN
      select case when branch in ('A25','B10','C10')  
      then 'BR B1' Else 'BR B2' 
      end As [COLLECTION],FIXDATE 
      from MAIN_COUNTER where TDATE=@D  --//Just want to pass date only
      group by COLLECTION,FIXDATE 
   END
  
   EXEC KK_SP_GETUSER_DIV
  </code></pre>
  <p><strong>Error:</strong></p>
  <blockquote>
  <p>Conversion failed when converting date and/or time from character string.</p>
  </blockquote>
  <p>What I have to do for it?</p>