title: MYSQL how to declare a datetime variable?
body: <p>My code: </p>
  
  <pre><code>DECLARE report_date DATETIME;
  set report_date='2013-01-17 00:00:00';
  
  SELECT  *
    FROM `NMPP`.`capacitypersecond` 
    WHERE `StreamDT` &gt;=report_date and `StreamDT` &lt; '2013-01-18 00:00:00'  ;
  
  SELECT  *
    FROM `NMPP`.`capacityperHr` 
    WHERE `StreamDT` &gt;=report_date and `StreamDT` &lt; '2013-01-18 00:00:00'  ;
  
  SELECT  *
    FROM `NMPP`.`capacityperDay` 
    WHERE `TJLDate` &gt;=report_date and `TJLDate` &lt; '2013-01-18 00:00:00'  ;
  </code></pre>
  
  <p>-</p>
  
  <pre><code>DECLARE report_date DATETIME;
  /* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECLARE report_date DATETIME' at line 1 */
  /* Affected rows: 0  Found rows: 0  Warnings: 0  Duration for 0 of 5 queries: 0.000 sec. */
  </code></pre>