title: Create date from day, month, year fields in MySQL
body: <p>I am currently developing an application that displays documents and allows the members to search for these documents by a number of different parameters, one of them being date range.</p>
  
  <p>The problem I am having is that the database schema was not developed by myself and the creator of the database has created a 'date' table with fields for 'day','month','year'.</p>
  
  <p>I would like to know how I can select a specific day, month, year from the table and create a date object in SQL so that I can compare dates input by the user using BETWEEN.</p>
  
  <p>Below is the structure of the date table:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `date` (
    `deposition_id` varchar(11) NOT NULL default '',
    `day` int(2) default NULL,
    `month` int(2) default NULL,
    `year` int(4) default NULL,
    PRIMARY KEY  (`deposition_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  </code></pre>