title: How to create a datetime from parts in Oracle/PLSQL?
body: <p>I have a date (4/30/2012), an hour (4) and a minute (45). I need to convert that to an Oracle datetime value for comparison in a PLSQL/Oracle SELECT statement. Ideally, there would be a function like this (C# since I know it a little better):</p>
  
  <pre><code>var date = "4/30/2012";
  var hour = "4";
  var minute = "45";
  DateTime myDateTime = convertDateTime(date, hour, minute);
  </code></pre>
  
  <p>I have a table with three columns to make up the date and time of an event. I have another table that has items that may or may not match based on their start and end dates. In pseudo SQL, here's what I'm trying to do:</p>
  
  <pre><code>SELECT 
      G.Name, 
      (SELECT MAX(Cost) 
          FROM CrappyTable AS C 
          WHERE G.StartTime &lt; convertDateTime(C.Date, C.Hour, C.Minute) 
          AND G.EndTime &gt; convertDateTime(C.Date, C.Hour, C.Minute)) as Cost
  FROM GoodTable as G
  WHERE G.Price &lt; 100.00;
  </code></pre>
  
  <blockquote>
    <p>OR "Select name and max cost (from reported cost during a time range)
    where the price is less than $100."</p>
  </blockquote>
  
  <p>Is there an existing function that might do something like the above <code>convertDateTime</code> function?</p>