title: Informix group by hour
body: <p>How one does use the group by clause with hour in Informix?</p>
  
  <p>The group by section here gives an error:</p>
  
  <pre><code>  SELECT
       cqdr.targetid, 
       cqdr.profileid, 
       ccdr.startdatetime::DATETIME HOUR TO HOUR AS CallHour,
       Count(cqdr.sessionid), 
       (Sum(cqdr.queuetime) / Count(cqdr.sessionid)), 
       Max(cqdr.queuetime)
     FROM Contactqueuedetail cqdr, Contactcalldetail ccdr, Selected_csqs sc
     WHERE cqdr.sessionid = ccdr.sessionid AND
           cqdr.sessionseqnum = ccdr.sessionseqnum AND
           cqdr.profileid = ccdr.profileid AND
           cqdr.nodeid = ccdr.nodeid AND
           ccdr.startdatetime BETWEEN DATE('12/6/27') AND DATE('12/6/28') AND 
           --cqdr.targettype = l_typecsq AND
           cqdr.targetid = sc.csqrecordid AND
           cqdr.profileid = sc.profileid
     GROUP BY ccdr.startdatetime::DATETIME HOUR TO HOUR, cqdr.targetid, cqdr.profileid;
  </code></pre>